This command got me very confused the other day while working on my little project app for tracking your blood pressure readings.

After brewing a fantastic medium roast specialty coffee from Brazil I found some brief explanations for this Docker command.

This post is going to be super brief. So, to sum up this is what I learned:

docker compose --rmi all 

Removes the images referenced in the docker-compose.yml file only.

The above will NOT remove images referenced in a Dockerfile that was used to build the services in a docker-compose file. For example:

 db:
    restart: always
    build: db/.

Inside my db directory I have a Dockerfile:

FROM mariadb:10.5
LABEL maintainer="ITPro Helper"
RUN apt update && apt install -y python3

Simple and brief example. I hope it helps. Some reference below:

https://github.com/docker/compose/issues/6971

Leave a comment

Your email address will not be published. Required fields are marked *