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
Managing images and containers in a Docker environment can be a simple task if you understand the right tools and commands. When creating an image and container, you could accumulate a large number of them over time, which could lead to a management problem. Let's learn how to handle it!
Docker Desktop is a graphical interface that makes it easy to manage your images and containers. In Docker Desktop, you can quickly see a list of the images you have stored, including their names and versions. Here's how to interact with it and manage your images:
docker build
, you can assign custom Tags to your images that allow you to discriminate versions through conventional numbering, such as "2.1.5".The terminal is a powerful tool to manage your Docker images with greater precision and flexibility. Here some essential commands:
List images:
docker images
This command will show you a complete list of your current images.
Filter images:
docker images --filter "reference=website:1.0"
Use the --filter
parameter to search for specific images by their reference or tag.
Display full image ID:
docker images --no-trunc
This will show you the Image ID in its full SHA-256 format.
There are several commands to modify or add tags to your images, which will help you to keep a more organized control:
docker image tag web_site:current admin/web_site:latest
This command assigns a new tag to one of your images, updating its reference for better management.Removing unnecessary images is crucial to maintain a clean and efficient environment. Here's how to do it:
Remove image tags:
docker rmi admin/website_site:latest.
This will remove the specific tag of the selected image.
Remove images based on ID:
docker rmi <image_id> .
Before doing this, make sure that no container is using the image, as you will not be able to delete it otherwise.
Force image deletion:
docker rmi -f <image_id>.
Use -f
to force the removal of the image, even if its tags are in use.
It is critical to have all the tools you need to effectively manage your images and containers in Docker. These commands and practices will allow you to keep your environment well organized, avoiding unnecessary clutter and maintaining clarity on the versions and statuses of each image. Keep exploring and improving your Docker skills to optimize your projects!
Contributions 18
Questions 1
Want to see more contributions, questions and answers from the community?