Fundamentos de Docker
¿Por qué aprender Docker?
Diferencia entre Máquinas Virtuales, Contenedores y Servicios
Instalación de Docker
Conociendo Docker Desktop
Conociendo Docker CLI
Creación de Imágenes con Docker
Mi primera imagen de Docker
Creación de imágenes con Dockerfile
De mi imagen a un contenedor usando CLI
Administrar mis imágenes de Docker
Administrar mis contenedores de Docker
Mejorando mi Dockefile
Volúmenes y Redes de Docker
Configurar volúmenes básicos en Docker
Configurar redes básicas en Docker
Publicando Imágenes de Docker
¡Mi primera imagen en Docker Hub!
Inspección y capas de un contenedor
Guardar y recuperar imágenes de Docker
Orquestación de Contenedores de Docker
Introducción a Docker Compose
Despliega un conjunto de imágenes
Cierre del curso
Esto solo es el comienzo
You don't have access to this class
Keep learning! Join and start boosting your career
Docker: Volume Management and Potential
Docker has revolutionized the world of application development with several powerful features, most notably the use of volumes. These are not mere storage spaces, but act as dynamic data bridges between our local environment and the containers running in Docker, enabling direct, real-time interaction with our applications. Let's unveil this functionality and explore how to leverage its potential in different scenarios.
Volumes in Docker offer the ability to share a drive or folder between your local machine and an active container. Important to distinguish, we are talking about containers and not Docker images; they are already running entities that allow live data manipulation.
Volumes are useful in multiple contexts. For example, you might want to update a website in real time without stopping your container. Or perhaps, in data analysis, you need to insert new data while processes are running. Volumes are key to maintaining that fluidity of work.
Setting up a volume is simple and here's how:
assets
) to host the files to share.Dockerfile
or Docker run command with the -v
parameter, specifying the local path and its destination in the container.docker ps
.When you use volumes, changes you make locally, such as updating an HTML file or deleting an image, will be instantly reflected in the container. This allows you to iterate nimbly over your project without the need to restart or rebuild the container.
The decision to use volume or COPY
command in your Dockerfile depends on the workflow you want to employ:
Choosing appropriately between creating a volume or copying data within your Docker image can be decisive for the efficiency and agility of your project. I hope these guidelines will help you optimize your Docker workflow and take full advantage of the potential of volumes - keep learning and experimenting!
Contributions 46
Questions 8
Pongan los recursos de la clase porfavor!
Utilizar los recursos de la clase 6.
Crear la carpeta /assets dentro de la carpeta /sitio
Descarga dos imágenes random y déjalas en /assets
Ejecuta docker run -it --rm -d -p 8080:80 -v ./sitio:/usr/share/nginx/html/sitio --name web nginx
Verificar en Docker Desktop el container “nginx” en la pestaña “Exec”:
assets linktree.html
batman.jpeg superman.jpg
superman.jpg
Recuerda que la url cambió a:
localhost:8080/sitio/linktree.html
En el archivo linktree.html utiliza:
COPY (cuando el contenido es estático)
VOLUMEN (cuando el contenido es dinámico)
Complejo… pero ahí vamos… gran curso y de gran utilidad.
En un entrevista técnica, la segunda pregunta fue si usaba Docker para crear contenedores, y por eso estoy aquí.
Siguiendo con la misma dinámica de preguntarle a la IA : ¿Cuál sería el comando exacto para ejecutar un contenedor Docker que utiliza la imagen de Nginx, la cual sirve los archivos de mi sitio web desde un directorio de mi maquina local y cuyos cambios se vean reflejados en el contenedor?
Want to see more contributions, questions and answers from the community?