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

前端 未结 5 1822
栀梦
栀梦 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:37

    What seems to be happening is docker was started with different user. Hence, docker ps -aq -f status=exited could not be run due permission issue and as a result got blank result.

    Running docker rm complains of missing argument due to blank result.

    michael@michael-desktop:~$ sudo docker rm -v $(docker ps -aq -f status=exited)
    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
    

提交回复
热议问题