是否可以嵌套Docker/Podman容器

发布于 2025-01-26 23:46:17 字数 1536 浏览 4 评论 0 原文

我运行Fedora 35,需要在Ubuntu的Docker运行一个应用程序。 我能够通过Podman

podman pull ubuntu:20.04 

和Setup Do Docker在那里获得Ubuntu,但无法运行它,因为我可能没有正确地进入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)

ERRO [2022-05-07T23:14:18.803335993+02:00]无法安装覆盖:操作不允许存储-DRIVER = OVERLAY2 erro [2022-05-07T23:14:18.803397023+02:00] exec:“ fuse-overlayfs”:在$ path storage-driver中找不到可执行文件 ERRO [2022-05-07T23:14:18.803500924+02:00] AUFS WDA在 /proc /proc /filesystems storemate-drover = aufs中找不到 ERRO [2022-05-07T23:14:18.803887844+02:00]无法安装覆盖层:操作不允许存储-DRIVER =

完全可以运行和应用程序可以使用Service以开放端口,以开放端口Podman有2层嵌套容器?

I run Fedora 35, and need to run an app in docker in ubuntu.
I was able to get and run ubuntu via podman

podman pull ubuntu:20.04 

and setup do docker there, but can't make it run as I probably didn't enter podman properly probably. I used:

podman run -it ubuntu:20.04

where I ran:

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

to start docker via systectl is not possible in the container, and dockerd command gives many error, mostly that it can't access overlay, and probably network (iptables)

ERRO[2022-05-07T23:14:18.803335993+02:00] failed to mount overlay: operation not permitted storage-driver=overlay2
ERRO[2022-05-07T23:14:18.803397023+02:00] exec: "fuse-overlayfs": executable file not found in $PATH storage-driver=fuse-overlayfs
ERRO[2022-05-07T23:14:18.803500924+02:00] AUFS wdas not found in /proc/filesystems storage-driver=aufs
ERRO[2022-05-07T23:14:18.803887884+02:00] failed to mount overlay: operation not permitted storage-driver=overlay

Is it possible at all to run and app with service to have open port to outside of docker, and podman as there are 2 layers of nested containers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦回旧景 2025-02-02 23:46:17

不可能在另一个容器内使用类型 Overlay 的默认存储驱动程序,您需要将存储更改为 vfs 。也许有帮助。

免责声明:这绝对是在Docker中运行Podman的情况下,但反之,我尚未进行测试。

It is not possible to use the default storage driver of type overlay inside another container, you need to change the storage to vfs. Maybe https://docs.docker.com/storage/storagedriver/vfs-driver/ helps.

Disclaimer: This works definitely in case of running podman in docker, but the other way around I have not tested.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文