tanszek:oktatas:iss_t:docker
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tanszek:oktatas:iss_t:docker [2023/04/02 16:56] – létrehozva knehez | tanszek:oktatas:iss_t:docker [2024/03/25 08:25] (current) – knehez | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Docker Virtualization in practice ==== | ==== Docker Virtualization in practice ==== | ||
- | In the following, we will see how the popular Docker virtualization/ | + | We will see how the popular Docker virtualization/ |
- | Please log in at http:// | + | Please log in at http:// |
After pressing the "+ Add new instance" | After pressing the "+ Add new instance" | ||
Line 92: | Line 92: | ||
* EXPOSE command opens a tcp port to the outside (in this case, 5000) | * EXPOSE command opens a tcp port to the outside (in this case, 5000) | ||
* copy everything to the working directory | * copy everything to the working directory | ||
- | the last line defines the startup command after installation, | + | * the last line defines the startup command after installation, |
- | Soronként | + | ==== Creating |
- | * Hozzon létre egy kiinduló virtuális gépet (image) a python 3.7-es támogatással és a **alpine** nevű linux kernellel. | + | In other tutorials, the virtual machine is started at this point. We don't do it, but move on to the possibilities of **docker-compose.yml**, which allows us to flexibly manage several virtual machines at the same time. It is not necessary to create |
- | | + | |
- | | + | |
- | * Telepítsük | + | |
- | * másoljuk be a requirements.txt-t a munkakönyvtárba (ez azért kell, mert a virtuális gépnek saját fájlrendszere van, a Dockerfile mellett lévő állományokat nem tudja közvetlenül olvasni.) | + | |
- | * EXPOSE parancs tcp portot nyit meg kifelé (jelen esetben az 5000-est) | + | |
- | * mindent másoljuk be a munkakönyvtárba | + | |
- | * az utolsó sor a telepítés utáni indító parancsot definiálja, | + | |
- | + | Create the docker-compose.yml | |
- | + | ||
- | ==== Compose állomány létrehozása ==== | + | |
- | + | ||
- | Más leírásokban ennél a pontnál elindítják a virtuális gépet. Mi nem tesszük meg, hanem továbblépünk a **docker-compose** lehetőségeire, | + | |
- | + | ||
- | Hozzuk létre a docker-compose.yml | + | |
< | < | ||
Line 124: | Line 111: | ||
</ | </ | ||
- | Ez az állomány szolgáltatásokban gondolkodik. Minden **service** egy különálló | + | Each //service// is a separate |
- | A **web** esetén a belsőleg kinyitott 5000-es portot láthatóvá tesszük a 80-as port-on. | + | In the case of the //web//, the internally opened |
- | Indítsuk el a következő parancsot és várjuk meg ameddig lefut: | + | Let's start the following command and wait until it runs: |
< | < | ||
Line 134: | Line 121: | ||
</ | </ | ||
- | A következő képernyőhöz hasonlót kell látnunk, ha mindent jól állítottunk be előzőleg. Nyomjuk meg a nyíllal jelölt gombot. | + | We should see something similar to the next screen, if everything was set up correctly previously. |
{{tanszek: | {{tanszek: | ||
+ | ==== Possibilities for development ==== | ||
- | ==== Fejlesztési lehetőségek ==== | + | Refresh the browser several times, we can see that the number of visits is updated dynamically. |
- | Frissítsük többször a böngészőt, | + | Ctrl + c can be used to stop the execution. |
- | Ctrl + c segítségével megállíthatjuk a futtatást. | + | replace the contents of //docker-compose.yml// with the following: |
- | + | ||
- | cseréljük le a docker-compose.yml | + | |
< | < | ||
Line 163: | Line 149: | ||
</ | </ | ||
- | A **volumes** | + | **volumes** |
- | Indítsuk el újra a rendszert: | + | Let's restart the system: |
< | < | ||
Line 171: | Line 157: | ||
</ | </ | ||
- | Majd látható, hogy a konzolban | + | Then you can see that we switched to developer |
- | ==== Docker compose | + | ==== Docker compose |
- | Futó virtuális gépek listázása: | + | List running virtual machines:: |
< | < | ||
Line 182: | Line 168: | ||
</ | </ | ||
- | Egy adott instance | + | What environment variables does a given instance |
< | < | ||
Line 188: | Line 174: | ||
</ | </ | ||
- | Hogyan állíthatjuk le a szolgáltatásokat? | + | How can we stop the services? |
< | < | ||
- | docker-compose stop | + | docker-compose stop < |
</ | </ | ||
- | Hogyan tudunk teljesen letörölni mindent leállítás után? | + | How can we completely wipe everything after shutdown? |
< | < | ||
Line 200: | Line 186: | ||
</ | </ | ||
- | Hogyan tudunk shellbe belépni egy konténeren belül? | + | How can we enter a shell inside a container? |
< | < | ||
Line 206: | Line 192: | ||
</ | </ | ||
- | Honnan tudok előre elkészített minta container-eket letölteni? | + | How can I see the logs? |
+ | < | ||
+ | docker-compose logs < | ||
+ | </ | ||
+ | |||
+ | |||
+ | Where can I download pre-made sample containers? | ||
https:// | https:// | ||
+ | Source code can be found here: https:// | ||
tanszek/oktatas/iss_t/docker.1680454606.txt.gz · Last modified: 2023/04/02 16:56 by knehez