permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied
"docker rm" requires at least 1 argument.
See 'docker rm --help'.
Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
what's on there? I wanna delete all previous running containers with a command. what can I do?
Try running both docker commands with sudo
inner shell commands are evaluated first so in your case docker ps runs first. But it require sudo permission and thus raises the error. So include sudo on that command i.e. sudo docker ps ...
btw learn to use prune commands. Docker can do what you want in just one command, no need to use ps.
Обсуждают сегодня