docker - 是否可以嵌套 docker/podman 容器

标签 docker ubuntu fedora podman

我运行 Fedora 35,需要在 ubuntu 的 docker 中运行一个应用程序。
我能够通过 podman 获取并运行 ubuntu

podman pull ubuntu:20.04 
并在那里设置 docker ,但无法使其运行,因为我可能没有正确输入 podman 。我用了:
podman run -it ubuntu:20.04
我跑的地方:
su -
apt update; apt upgrade
apt install inetutils-ping nano sudo npm
apt install apt-transport-https ca-certificates curl gnupg
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \                                                                                            $(lsb_release -cs) stable" |sudo tee /etc/apt/sources.list.d/docker.list > /dev/null                                                                                                                                  apt update
apt install docker-ce docker-ce-cli containerd.io
通过 systectl 启动 docker在容器中是不可能的,dockerd命令给出了许多错误,主要是它无法访问覆盖,并且可能是网络(iptables)
错误 [2022-05-07T23:14:18.803335993+02:00] 无法挂载覆盖:不允许操作 storage-driver=overlay2
错误 [2022-05-07T23:14:18.803397023+02:00] exec:“fuse-overlayfs”:$PATH storage-driver=fuse-overlayfs 中找不到可执行文件
错误 [2022-05-07T23:14:18.803500924+02:00] 在/proc/filesystems storage-driver=aufs 中找不到 AUFS wdas
错误 [2022-05-07T23:14:18.803887884+02:00] 无法挂载覆盖:不允许操作存储驱动程序 = 覆盖
由于有 2 层嵌套容器,是否有可能运行和应用程序服务以开放端口到 docker 和 podman 外部?

最佳答案

无法使用 overlay 类型的默认存储驱动程序在另一个容器中,您需要将存储更改为 vfs .也许 https://docs.docker.com/storage/storagedriver/vfs-driver/有帮助。
免责声明:这绝对适用于在 docker 中运行 podman,但反过来我还没有测试过。

关于docker - 是否可以嵌套 docker/podman 容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72156494/

相关文章:

linux - MEM 向 <主机> 发送 STATUS 命令时出错,配置将被重置 : MEM: Can't read node

ruby-on-rails - 无法使用 OpenSSL 编译 Ruby

linux - 在 Fedora (Linux) 中自动将屏幕截图复制到剪贴板

python - Fedora 17 中的 vpython GdkGLExt-警告

docker - Docker镜像到Docker文件

image - gitlab ci yml 图像和服务机制?

mysql - Galera mysql集群在Kubernetes中启动失败

ubuntu - 无法在 3.8 内核上编译 Vagrant VirtualBox Guest Additions

rust - sdl2-sys 无法编译 - 无法执行链接器 : No such file or directory

linux - Debian 11 (bullseye) 上的 "The repository does not have a Release file"错误,即使存储库有 Release 文件