docker compose rm | Docker-compose remove container
RemovesstoppedservicecontainersUsage$dockercomposerm[OPTIONS][SERVICE...]Refertotheoptionssection[1]foranoverviewofavailableOPTIONS[2]forthiscommand.DescriptionRemovesstoppedservicecontainers.Bydefault,anonymousvolumesattachedtocontainersarenotremoved.Youcanoverridethiswith-v.Tolistallvolumes,usedockervolumels.Anydatawhichisnotinavolumeislost.Runningthecommandwithnooptionsalsoremovesone-offcontainerscreatedbydockercomposerun:$dockercomposermGoingtoremovedjangoquickstart_web_run_1Areyousure?[...
Removes stopped service containers
Usage $ docker compose rm [OPTIONS] [SERVICE...]Refer to the options section[1] for an overview of available OPTIONS[2] for this command.
DescriptionRemoves stopped service containers.
By default, anonymous volumes attached to containers are not removed. You can override this with -v. To list all volumes, use docker volume ls.
Any data which is not in a volume is lost.
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 Options Name, shorthand Default Description --all , -a Deprecated - no effect --force , -f Dont ask to confirm removal --stop , -s Stop the containers, if required, before removing --volumes , -v ...