Closed DavidMachacek closed 3 years ago
@rhatdan Got a Podman-in-Podman bug for you and @umohnani8
@DavidMachacek Have you looked at https://developers.redhat.com/blog/2019/08/14/best-practices-for-running-buildah-in-a-container/
@rhatdan there is link to stable Dockerfile which no longer exists, so I went for this one.
I built it buildah bud -f Dockerfile -t builder
and ran podman run -v ./build:/build:z -v /var/lib/containers1:/var/lib/containers:Z --device /dev/fuse -ti builder
, but when I was inside it, I installed podman dnf install -y podman
and then start podman version
, but got following error
Error: mount /var/lib/containers/storage/overlay:/var/lib/containers/storage/overlay, flags: 0x1000: operation not permitted
.
I was succesfull in building image inside it using buildah (from Dockerfile inside ./build folder), but I am still looking for a solution to run container inside container without Docker-in-Docker, not to just build them, in order to i.e. run component test with multiple containers (ie. start service container against another DB container) in my pipelines (without them I dont want to push untested container image to registry). I watched several of your talks on youtube too but didnt find the answer.
I acknowledge this topic might not be a bug, but still I would love to see my podman container inception running :)
BTW: I am a big fan of your work! 👍
You need to use the fuse-overlay driver for now.
@rhatdan I am using it. podman run -v test:/var/lib/containers:Z --device /dev/fuse -ti --log-level debug new-container
ends with
DEBU[0000] [graphdriver] trying provided driver "overlay" DEBU[0000] overlay: imagestore=/var/lib/shared DEBU[0000] overlay: mount_program=/usr/bin/fuse-overlayfs Error: mount /var/lib/containers/storage/overlay:/var/lib/containers/storage/overlay, flags: 0x1000: operation not permitted
@giuseppe PTAL
If /usr/bin/newuidmap and /usr/bin/newgidmap are installed as setuid binaries you need to add CAP_SYS_ADMIN.
If they use file capabilities as on Fedora, CAP_SETUID and CAP_SETGID are enough.
@giuseppe Ubuntu 20:04
step 1) podman run -v /var/lib/containers1:/var/lib/containers:Z --device /dev/fuse -ti --cap-add CAP_SYS_ADMIN my-container based on builder
Inside Fedora-based container as rootless user:
step 1) sudo dnf install -y podman
step 2) podman run --net=host --events-backend=file fedora
returns Error: cannot setup namespace using newuidmap: exit status 1
I reinstalled shadow-utils and chmod 4755 /usr/bin/newu(g)idmap with no help, getcap /usr/bin/newuidmap /usr/bin/newgidmap
returns
/usr/bin/newuidmap cap_setuid=ep
/usr/bin/newgidmap cap_setgid=ep
When I do it as root, I get Error: cannot chown /var/lib/containers/storage/overlay/c9448f1effa1206f7251da933500d757753df04b7bc6b611797190156a17ec4e/merged to 0:0: chown /var/lib/containers/storage/overlay/c9448f1effa1206f7251da933500d757753df04b7bc6b611797190156a17ec4e/merged: operation not permitted
A friendly reminder that this issue had no activity for 30 days.
We have just published
https://www.redhat.com/sysadmin/podman-inside-container And https://www.redhat.com/sysadmin/podman-inside-kubernetes
Please read these and see if they help solve your problem. Reopen if you need more information.
/kind bug
Description I would like to start Ubuntu based image for building and running containers inside pipeline.
Steps to reproduce the issue:
Build base container using
podman build -f inception-Dockerfile -t host-container .
DockerfileRun the container using
podman run -v mycontainers:/var/lib/containers -ti host-container
For some reason I have to pass volume with mounted overlayFS for host-container (by using something likemount -t overlay -o lowerdir=base,upperdir=diff,workdir=workdir overlayfs overlay)
otherwise I get ERRORERRO[0000] 'overlay' is not supported over <unknown> at "/var/lib/containers/storage/overlay" Error: kernel does not support overlay fs: 'overlay' is not supported over <unknown> at "/var/lib/containers/storage/overlay": backing file system is unsupported for this graph driver
Alter
/etc/containers/storage.conf
to enable VFS (setting driver="vfs" and deleting mountopt)Inside host-container start any other container, i.e.
sudo podman run -ti fedora --privileged --host=net
Describe the results you received:
Describe the results you expected: Running container inside host-container
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (
apt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? Yes
Additional environment details (AWS, VirtualBox, physical, etc.): AWS backed Ubuntu 20:04
Other problem I have to use sudo for every podman command. Otherwise I get
/proc/self/uid_map: 0 1000 1 1 100000 65536
/proc/self/gid_map 0 1000 1 1 100000 65536
Questions 1) Why cant I run new container inside my podman host-container? 2) How can I avoid having to prepare overlayFS volume for host-container? 3) Why do I get Error: cannot setup namespace using newuidmap error without sudo?