1

不确定这是一个码头问题,但事情就是这样:我试过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"

按照这个 stackoverflow 建议我做了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?值(尽管状态是活动的)。

4

2 回答 2

0

我认为您使用 snap 安装了 docker,并且 snapd 的安装不完整“snap-confine 具有提升的权限并且没有受到限制,但应该是。拒绝继续避免权限升级攻击。

” 此错误表示“apparmor”服务未启用。

 sudo systemctl enable --now apparmor
 sudo systemctl status apparmor

如果未安装 apparmor,请安装它:

  sudo apt-get install apparmor

此错误“bash: /snap/bin/docker-compose”表示“/snap/bin”不在您的 PATH 中。如果你运行它snap --version,你可能会得到一个错误,说“/snap/bin”不在 PATH 中。

sudo nano /etc/environment

添加“/snap/bin”

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/snap/bin

现在您需要重新启动系统。一切都应该修复。

于 2021-07-18T03:15:05.923 回答
0

创建/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

此信息取自此 docker 论坛讨论

于 2021-05-27T14:46:47.653 回答