Herramientas de usuario

Herramientas del sitio


informatica:sistemas_operativos:cursos:docker_avanzado:ejercicios_practicos

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
informatica:sistemas_operativos:cursos:docker_avanzado:ejercicios_practicos [2023/10/10 18:57] tempwininformatica:sistemas_operativos:cursos:docker_avanzado:ejercicios_practicos [2023/10/10 18:58] (actual) tempwin
Línea 9: Línea 9:
 </code> </code>
  
-2. (pull) Pull an image from the official registry, eg: debian:latest (you can browse https://store.docker.com if you want to find other images).+2. (**pull**) Pull an image from the official registry, eg: debian:latest (you can browse https://store.docker.com if you want to find other images).
  
 <code> <code>
Línea 25: Línea 25:
 </code> </code>
  
-3. (run) Run a container from this image.+3. (**run**) Run a container from this image.
  
 <code> <code>
Línea 41: Línea 41:
 The default command of the debian image is ''/bin/bash'' and by default docker containers are run without stdin (it is redirected from ''/dev/null'' ). Thus bash exits immediately. The default command of the debian image is ''/bin/bash'' and by default docker containers are run without stdin (it is redirected from ''/dev/null'' ). Thus bash exits immediately.
  
-4. (run a command) You may override the default command by providing extra arguments after the image name. Then this command will be executed (instead of bash).+4. (**run a command**) You may override the default command by providing extra arguments after the image name. Then this command will be executed (instead of bash).
  
 <code> <code>
Línea 48: Línea 48:
 </code> </code>
  
-5. (stdin) Let's go back to bash, this time we want interact with the shell. To keep stdin open, we launch the container with ''-i/%%--%%interactive''.+5. (**stdin**) Let's go back to bash, this time we want interact with the shell. To keep stdin open, we launch the container with ''-i/%%--%%interactive''.
  
 <code> <code>
Línea 58: Línea 58:
 Bash is in batch mode because it is not running on a terminal (its stdout is a pipe, not a tty). Bash is in batch mode because it is not running on a terminal (its stdout is a pipe, not a tty).
  
-6. (tty) To have a real interactive shell inside our container, we need to allocate a tty with ''-t/%%--%%tty'':+6. (**tty**) To have a real interactive shell inside our container, we need to allocate a tty with ''-t/%%--%%tty'':
  
 <code> <code>
Línea 64: Línea 64:
 </code> </code>
  
-7. (start) You can exit your container and display the list of all containers:+7. (**start**) You can exit your container and display the list of all containers:
  
 <code> <code>
Línea 80: Línea 80:
 </code> </code>
  
-8. (commit) You can modify files inside a container. If you restart the same container you can note that these changes are still present. However they will not be present in the other container (even if they are running the same image) because docker uses a copy-on-write filesystem. +8. (**commit**) You can modify files inside a container. If you restart the same container you can note that these changes are still present. However they will not be present in the other container (even if they are running the same image) because docker uses a copy-on-write filesystem. 
  
 Use the command ''docker diff'' to show the difference of a container from its image. Use the command ''docker diff'' to show the difference of a container from its image.
Línea 94: Línea 94:
 Note: ''docker commit'' does not affect the state of the container. If it is running, then it just keeps running. You may take as many snapshots as you like. Note: ''docker commit'' does not affect the state of the container. If it is running, then it just keeps running. You may take as many snapshots as you like.
  
-9. (rm) You now have too many dead containers in your engine. You should use ''docker rm'' to remove them. Alternatively you can run ''docker container prune'' which removes all dead container.+9. (**rm**) You now have too many dead containers in your engine. You should use ''docker rm'' to remove them. Alternatively you can run ''docker container prune'' which removes all dead container.
  
-10. (extras) If you still have extra time, you can experiment o the other docker run options we introduced so far:+10. (**extras**) If you still have extra time, you can experiment o the other docker run options we introduced so far:
  
   * ''%%--%%rm'' to remove the container automatically when it terminates   * ''%%--%%rm'' to remove the container automatically when it terminates
informatica/sistemas_operativos/cursos/docker_avanzado/ejercicios_practicos.1696957043.txt.gz · Última modificación: por tempwin