启动 docker 实例时出现问题



不确定这是一个特定的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"

按照这个堆栈溢出建议,我做了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).

我尝试重新安装码头工人。 以相同的Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?运行sudo docker run hello-world调谐器(尽管状态为活动) .

创建包含以下内容的文件/etc/systemd/network/bridge.network

[Network]
IPFoward=kernel

如果没有保存权限,请在根模式 (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 论坛讨论。

我认为您使用 snap 安装了 docker 并且 snapd 的安装尚未完成"snap-conlimit 具有提升的权限并且不受限制,但应该如此。拒绝继续避免权限升级攻击。

"此错误表示未启用"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

添加"/快照/垃圾桶">

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

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

相关内容

  • 没有找到相关文章

最新更新