Hi, i have a question about two commands: docker-compose down and docker-compose rm
I have a different directories for every docker-compose.yml, so when i build containers i jump from dir to dir performing docker-compose up -d
Now, what happens if i want to remove a container? or its image also? I just have to go into the directory where its yml file resides and perform the down command? Or i should use the rm command?
rm - won’t remove a container if it’s running. It only removes already stopped containers down - will stop a running container AND remove it as well. In addition to that it will remove networks, images and volumes
The ‘down’ option execute the ‘stop’ and ‘rm’ options ( in that order ), plus remove containers and managed networks; and if add the ‘-v’ extra flag, can delete the volumes too.