Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

339
Views
What's the difference between 'down' and 'rm' in docker/docker-compose?

The docs for docker-compose down, docker-compose rm, and docker rm all read very similarly. What's the difference? And when would you use one over the others?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

  • "docker-compose down": stop and remove the container with all the networks (but not volumes), you should add -v option to do that.
  • "docker-compose rm": remove stopped only containers, but not running containers, you should add option -s to be able to remove running containers

Now, the diffrence between "docker-compose rm" and "docker rm", is that when you make changes affecting the container in the docker-compose.yml file, you can't remove the container created by the old docker-compose.yml using "docker-compose rm", so in this case you should use "docker rm" to do that.

If you still don't get it, you can try this example:

  1. Run a container using "docker-compose up"
  2. Now stop the container without removing it using "docker-compse stop"
  3. Change the name of the container in the docker-compose.yml
  4. Run "docker-compose up" --> a new container will be created with the new name.
  5. Now if you try to remove the old container using "docker-compose rm old_container_name", you will get this error: No such service.
  6. In this case you can only remove the old container using "docker container rm old_container_name".
over 4 years ago · Santiago Trujillo Report

0

rm - Removes stopped service containers.

down - Stops containers and removes containers, networks, volumes, and images created by up.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!