DOCKER-COMPOSE-RM(1)

πŸ“¦ version 2.26.1, in debian trixie

πŸ’… docker-compose-rm β€” bestie edition ✨

okay so the manual name is docker-compose-rm and it lives in the docker-compose-rm(1) section, if you were wondering πŸŽ€


🌸 NAME 🌸

docker-compose-rm β€” removes stopped service containers. yes, the actual name of the game. it takes out the trash πŸ—‘οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

docker compose rm [OPTIONS] [SERVICE...]

that's it. that's the whole vibe. options optional, services optional, chaos optional πŸ’€


πŸ’– DESCRIPTION πŸ’–

So. Removes stopped service containers. That's the whole job, and she does it well πŸ‘‘

By default, anonymous volumes attached to containers are not removed. You can override this with -v. And if you wanna list all volumes, use docker volume ls. iykyk 🫢

⚠️ Any data which is not in a volume is lost. Like, gone gone. not "in the recycle bin" gone. LOST. no cap, please be careful 😭

Running the command with no options also removes one-off containers created by docker compose run:

$ docker compose rm
Going to remove djangoquickstart_web_run_1
Are you sure? [yN] y
Removing djangoquickstart_web_run_1 ... done

look at her go, so efficient, so demure, so mindful 🧚


✨ OPTIONS ✨

  • -f, --force[=false] β€” don't ask to confirm removal. she just does it. no questions, no hesitation, main character energy πŸ’…
  • -h, --help[=false] β€” help for rm. your little emotional support flag πŸ₯Ί
  • -s, --stop[=false] β€” stop the containers, if required, before removing. like, she'll tuck them in first before yeeting them 🌈
  • -v, --volumes[=false] β€” remove any anonymous volumes attached to containers. the override for that default behavior we mentioned up top πŸ‘†

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

  • --dry-run[=false] β€” execute command in dry run mode. a little rehearsal, a little dress rehearsal, nothing actually happens πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯


kay so that's the whole page, you ate that, go forth and clean up your stopped containers responsibly bestie πŸ’œ

this lil masterpiece is from Mar 2025, filed under DOCKER-COMPOSE-RM(1) β€” mwah, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from