【发布时间】:2021-10-13 19:31:44
【问题描述】:
我尝试清除当前的 docker 容器,但出现权限被拒绝错误:
usernam2@ubuntuOS:/ProjectPath/DOCKER$ docker rm $(docker ps -a -q)
9790e408ff40
Error response from daemon: You cannot remove a running container a74d9ad73c264c800c3628738c0f4b62f187aa51c7f93cbfc539494903a72f38. Stop the container before attempting removal or force remove
usernam2@ubuntuOS:/ProjectPath/DOCKER$ docker-compose down --remove-orphans
Stopping lar_nginx_web ... error
ERROR: for lar_nginx_web cannot stop container: a74d9ad73c264c800c3628738c0f4b62f187aa51c7f93cbfc539494903a72f38: Cannot kill container a74d9ad73c264c800c3628738c0f4b62f187aa51c7f93cbfc539494903a72f38: unknown error after kill: runc did not terminate sucessfully: container_linux.go:392: signaling init process caused "permission denied"
: unknown
Removing network docker_default
ERROR: error while removing network: network docker_default id 3f04876099e732d53f693929d90b316b269383f2b2c3a2b5f84f607992001125 has active endpoints
usernam2@ubuntuOS:/ProjectPath/DOCKER$ docker system prune --force --volumes
Total reclaimed space: 0B
usernam2@ubuntuOS:/ProjectPath/DOCKER$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a74d9ad73c26 docker_app "docker-php-entrypoi…" 13 minutes ago Up 13 minutes 9000/tcp lar_nginx_web
usernam2@ubuntuOS:/ProjectPath/DOCKER$ docker-compose down
Stopping lar_nginx_web ... error
ERROR: for lar_nginx_web cannot stop container: a74d9ad73c264c800c3628738c0f4b62f187aa51c7f93cbfc539494903a72f38: Cannot kill container a74d9ad73c264c800c3628738c0f4b62f187aa51c7f93cbfc539494903a72f38: unknown error after kill: runc did not terminate sucessfully: container_linux.go:392: signaling init process caused "permission denied"
: unknown
Removing network docker_default
ERROR: error while removing network: network docker_default id 3f04876099e732d53f693929d90b316b269383f2b2c3a2b5f84f607992001125 has active endpoints
我想我没有 tio 以 root 身份运行它们,但即使以 root 身份运行我也遇到了同样的错误。
如何解决?
谢谢!
【问题讨论】:
标签: ubuntu docker-compose