Skip to content

Commit c993c82

Browse files
committed
wip: chkpwd apparmour hack
1 parent 5834187 commit c993c82

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

ci/docker/os-image-stemcell-builder/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ FROM $BASE_IMAGE
44

55
LABEL maintainer="cf-bosh@lists.cloudfoundry.org"
66

7+
ARG USER_ID=1000
8+
ARG GROUP_ID=1000
9+
710
# BUILD_ARGs
811
ARG META4_CLI_URL
912
ARG SYFT_CLI_URL
@@ -66,7 +69,15 @@ RUN apt-get update \
6669
xvfb \
6770
&& locale-gen ${LANG}
6871

69-
RUN echo 'ubuntu ALL=NOPASSWD:ALL' >> /etc/sudoers
72+
# AppArmor's unix-chkpwd profile can block the Rosetta translator under
73+
# docker run --privileged on Apple Silicon; use a distinct helper name so PAM still works.
74+
RUN cp /usr/sbin/unix_chkpwd /usr/sbin/unix_chkpwd_rosetta \
75+
&& chmod 4755 /usr/sbin/unix_chkpwd_rosetta \
76+
&& ln -sf unix_chkpwd_rosetta /usr/sbin/unix_chkpwd
77+
78+
RUN (id -u ubuntu &>/dev/null || useradd -u ${USER_ID} -g ${GROUP_ID} -m ubuntu) \
79+
&& usermod -p '*' ubuntu \
80+
&& echo 'ubuntu ALL=NOPASSWD:ALL' >> /etc/sudoers
7081

7182
RUN temp_dir="/mnt/tmp" \
7283
&& mkdir -p "${temp_dir}" \

0 commit comments

Comments
 (0)