Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

346
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda