我正在Docker上閱讀一本書。這是幾歲。刪除所有已停止的容器:「docker rm」至少需要1個參數
我會舉:
If you want to get rid of all your stopped containers, you can use
the output of docker ps -aq -f status=exited , which gets the
IDs of all stopped containers. For example:
$ docker rm -v $(docker ps -aq -f status=exited)
當我跑,我得到:
[email protected]:~$ 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: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.30/containers/json?all=1&filters=%7B%22status%22%3A%7B%22exited%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied
"docker rm" requires at least 1 argument(s).
See 'docker rm --help'.
Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
你能幫我明白我應該怎麼辦,以獲得什麼打算。
的可能的複製[如何刪除舊的Docker容器(https://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers) –
如果你有最近的碼頭工人版本至少1.11我認爲,只要做'碼頭容器修剪' – papey