Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit e3e6f0f

Browse files
committed
fix permissions for podman to work inside the build environment
1 parent 4af2222 commit e3e6f0f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

final/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,21 @@ RUN sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http:
4848
$PKG_DEV_TOOLS \
4949
$PKG_AWS_TOOLS \
5050
$PKG_EXTRA_PACKAGES \
51-
$PKG_PYTHON_LIBS && \
51+
$PKG_PYTHON_LIBS \
52+
libcap2-bin && \
53+
# START fix podman permissions -- see comment below \
54+
sudo chmod 0755 /usr/bin/newuidmap /usr/bin/newgidmap && \
55+
sudo setcap cap_setuid=ep /usr/bin/newuidmap && \
56+
sudo setcap cap_setgid=ep /usr/bin/newgidmap && \
57+
sudo apt-get autoremove --purge -y libcap2-bin && \
58+
# END fix podman permissions \
5259
sudo apt-get clean && \
5360
sudo rm -rf /var/lib/apt/lists/*
5461

62+
# For info on the fix to podman in container, see https://samuel.forestier.app/blog/security/podman-rootless-in-podman-rootless-the-debian-way
63+
# Replace setuid bits by proper file capabilities for uidmap binaries.
64+
# See <https://github.com/containers/podman/discussions/19931>.
65+
5566
## java version required by render framework parser
5667
RUN case $(uname -m) in \
5768
x86_64) sudo update-alternatives --set java /usr/lib/jvm/java-${BENV_JAVA_VERSION}-openjdk-amd64/bin/java && \
@@ -62,6 +73,7 @@ RUN case $(uname -m) in \
6273
;; \
6374
esac
6475

76+
RUN apt-get install -y && \
6577

6678
# gradle
6779
RUN sudo wget https://services.gradle.org/distributions/gradle-7.3.3-bin.zip -O /usr/local/lib/gradle.zip

0 commit comments

Comments
 (0)