File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ podman run --rm \
1818 --cap-add=SETGID \
1919 --security-opt seccomp=unconfined \
2020 --security-opt label=disable \
21+ --userns=keep-id \
2122 -v /opt/workdir/images/test-rocky-9.5.yaml:/home/builder/config.yaml \
2223 ghcr.io/openchami/image-build:latest \
2324 image-build --config config.yaml --log-level DEBUG
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33
4- # Only su if running as root
5- if [[ " $( id -u) " == " 0" ]]; then
6- exec su - builder -c " buildah unshare $* "
7- else
8- exec buildah unshare " $@ "
9- fi
4+ # Only do this if you really need to override inside-container subuid/gid behavior
5+ # Usually not needed unless you're testing mapping features
6+ if [[ -w /etc/subuid && -w /etc/subgid ]]; then
7+ echo " builder:1001:${USERNS_RANGE:- 65536} " > /etc/subuid
8+ echo " builder:1001:${USERNS_RANGE:- 65536} " > /etc/subgid
9+ fi
10+
11+ # Make sure builder owns its homedir (optional if baked into image)
12+ chown -R builder /home/builder || true
13+
14+ # Run buildah directly
15+ exec buildah unshare " $@ "
16+
You can’t perform that action at this time.
0 commit comments