Remove all stopped containers: “docker rm” requires at least 1 argument

前端 未结 5 1853
栀梦
栀梦 2021-02-13 12:55

I\'m reading a book on docker. It is a couple of years old.

I\'ll cite:

If you want to get rid of all your stopped containers, you can use
the output of          


        
5条回答
  •  悲哀的现实
    2021-02-13 13:22

    Actually its an rights issue.... the error message:

    Got permission denied while trying to connect to the Docker daemon socket at unix://
    

    Tells you that you cant connect to you docker daemon which is running under root. You should decide if you want to use docker with # sudo or as root user.

    Manage Docker as a non-root user

    Further as said the docker rm complains about no images found for deletion therefore it wouldn't possible to delete images.

    The command docker rm $(docker ps -aq -f status=exited) is just fine with newest docker version 18.09.0 but you could use docker container prune as well that is the more interactive way.

提交回复
热议问题