我今晚第一次尝试 Docker!
运行 Ubuntu 22.04,仅 cli。在此过程之前和过程中更新和升级所有内容,并且都在新机器上的新帐户上。
我一直在关注官方说明,但是我在启动测试容器时遇到了这个问题:
$ sudo docker run hello-world
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "proc" to rootfs at "/proc": mount proc:/proc (via /proc/self/fd/6), flags: 0xe: permission denied: unknown.
ERRO[0000] error waiting for container:
环顾互联网,这似乎意味着我需要嵌套安全性。对我来说很有意义......但是关于如何做到这一点的信息并不多。我能找到的最好的是this SO answer说我需要使用
lxc
。从来没有听说过,但这似乎在这些东西中很常见,所以我apt-get
它并尝试他们的答案,但我明白了:
$ lxc config set deploy-container security.nesting true
Traceback (most recent call last):
File "<string>", line 1, in <module>
PermissionError: [Errno 13] Permission denied
/usr/sbin/lxc: 6: exec: /snap/bin/lxc: not found
我看到权限被拒绝所以我尝试
sudo
:
$ sudo lxc config set deploy-container security.nesting true
Traceback (most recent call last):
File "<string>", line 1, in <module>
ConnectionResetError: [Errno 104] Connection reset by peer
/usr/sbin/lxc: 6: exec: /snap/bin/lxc: not found
基本上是一样的错误。说它在
<string>
的第1行让我认为某处存在语法错误但我不知道在哪里也不知道可以修复它。
谷歌搜索这个,我找不到任何东西。这是怎么回事,我该如何解决?