不确定这是一个 docker 问题,但情况是这样的:我试过 sudo docker stop 7f8c9285465c
这导致Error response from daemon: cannot stop container: 7f8c9285465c: Cannot kill container...unknown error after kill: runc did not terminate sucessfully: container_linux.go:392: signaling init process caused "permission denied"
关注 this stackoverflow suggestion我做了sudo aa-remove-unknown
.现在docker stop
成功但随后 docker-compose up
导致:snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks
.
接下来我运行命令 sudo apt purge snapd snap-confine && sudo apt install -y snapd
.正在运行 docker-compose up
结果是bash: /snap/bin/docker-compose: No such file or directory
.
命令sudo docker container ls
结果是:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
sudo service docker status
返回 Active: active (running)
.
我尝试重新安装docker。运行 sudo docker run hello-world
返回相同的Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
(虽然状态是活跃的)
.
最佳答案
创建文件/etc/systemd/network/bridge.network
内容:
[Network]
IPFoward=kernel
如果没有保存权限,请在 root 模式下保存 (sudo su -
)。然后,运行:
sudo systemctl restart systemd-networkd.service # (disconnected network)
sudo apt remove docker-ce # If you hadn't done so before
sudo apt install docker-ce # Should start docker.service
sudo systemctl status docker.service # Verify docker.service is running
此信息取自 this docker forum discussion .
关于docker - 启动 docker 实例的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67721396/