How to stop a Docker Compose container and delete the associated image, then create a new build

Tiempo de lectura: < 1 minuto

Today we’re going to learn how to delete the Docker image when performing a Docker Compose down to then regenerate an update without generating garbage.

The command we should use to stop the container and delete the associated image is:

docker-compose down --rmi all

This will remove the associated images of that Docker Compose.

To regenerate them:

 docker compose up -d --build

Leave a Comment