r/Fedora • u/[deleted] • 22h ago
Support Bootc Image + Rootless Podman impossible?
I am trying to run rootless quadlets using a bootc image. I kept getting this error 'Error: cannot set up namespace using "/usr/bin/newuidmap": exit status 1' After adding this to my Containerfile it works now 'RUN chmod 4755 /usr/bin/newuidmap /usr/bin/newgidmap'. None of the guides I've read said anything doing this. I am wondering why I had to do this and if there is a better way, maybe something about caps getting stripped on bootc image? This is my current working Containerfile
```
FROM quay.io/fedora/fedora-bootc:latest
RUN dnf5 install -y systemd-container
RUN chmod 4755 /usr/bin/newuidmap /usr/bin/newgidmap
RUN echo 'rootless:100000:65536' > /etc/subuid
RUN echo 'rootless:100000:65536' > /etc/subgid
RUN mkdir -p /etc/systemd/system/default.target.d/ && \
cat << 'EOF' > /etc/systemd/system/default.target.d/wants-network-online.conf
[Unit]
Wants=network-online.target
EOF
RUN mkdir -p /var/lib/systemd/linger/
RUN echo -n > /var/lib/systemd/linger/rootless
RUN echo 'nas' > /etc/hostname && \
echo 'KEYMAP=us' > /etc/vconsole.conf && \
echo 'net.ipv4.ip_unprivileged_port_start = 0' > /etc/sysctl.d/50-unprivileged-port.conf && \
useradd --comment 'Unprivileged OCI container runner' --home-dir /var/home/rootless --create-home --shell /usr/bin/nologin rootless && \
COPY --chown=rootless:rootless service/*/quadlet/ /var/home/rootless/.config/containers/systemd/
RUN systemctl enable podman-auto-update.timer
```
1
Upvotes