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:

    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:

Leave a comment

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