@@ -3,39 +3,27 @@ FROM $BASE_IMG AS buildah-runner
3
3
4
4
USER root
5
5
6
- # Some complex config is required to allow buildah to run in a nonprivileged container.
7
6
# https://github.com/containers/buildah/blob/master/docs/tutorials/05-openshift-rootless-bud.md
8
7
# https://github.com/containers/buildah/blob/master/contrib/buildahimage/stable/Dockerfile
9
8
# https://github.com/containers/buildah/issues/1011
9
+ # https://github.com/containers/buildah/issues/3053
10
10
11
- RUN dnf -y install shadow-utils xz slirp4netns buildah podman fuse-overlayfs --exclude container-selinux && \
11
+ RUN dnf -y install xz slirp4netns buildah podman fuse-overlayfs --exclude container-selinux && \
12
+ dnf -y reinstall shadow-utils && \
12
13
dnf clean all
13
14
14
15
ENV BUILDAH_ISOLATION=chroot
15
16
16
17
ADD https://raw.githubusercontent.com/containers/buildah/master/contrib/buildahimage/stable/containers.conf /etc/containers/
17
18
18
- # ADD https://raw.githubusercontent.com/containers/buildah/master/contrib/buildahimage/stable/containers.conf /etc/containers/
19
19
RUN chgrp -R 0 /etc/containers/ && \
20
20
chmod -R a+r /etc/containers/ && \
21
21
chmod -R g+w /etc/containers/
22
- # echo "user.max_user_namespaces=65536" > /etc/sysctl.d/userns.conf && \
23
- # prevents errors from failing to log using systemd https://github.com/containers/podman/issues/4325#issuecomment-570650857
24
- # See https://github.com/containers/common/blob/master/docs/containers.conf.5.md for valid configurations
25
- # printf '[engine]\nevents_logger = "file"\n' >> /etc/containers/containers.conf
26
- # printf 'events_logger = "file"\n' >> /etc/containers/containers.conf
27
-
28
- # Adjust storage.conf to enable Fuse storage.
29
- RUN chmod 644 /etc/containers/containers.conf; sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' /etc/containers/storage.conf
30
- RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers /var/lib/shared/vfs-images /var/lib/shared/vfs-layers; touch /var/lib/shared/overlay-images/images.lock; touch /var/lib/shared/overlay-layers/layers.lock; touch /var/lib/shared/vfs-images/images.lock; touch /var/lib/shared/vfs-layers/layers.lock
31
22
32
23
# Use VFS since fuse does not work
33
24
# https://github.com/containers/buildah/blob/master/vendor/github.com/containers/storage/storage.conf
34
25
RUN mkdir -vp /home/${USERNAME}/.config/containers && \
35
26
printf '[storage]\n driver = "vfs"\n ' > /home/${USERNAME}/.config/containers/storage.conf && \
36
27
chown -Rv ${USERNAME} /home/${USERNAME}/.config/
37
28
38
- RUN printf "${USERNAME}:2000:50000\n " > /etc/subuid
39
- RUN printf "${USERNAME}:2000:50000\n " > /etc/subgid
40
-
41
29
USER $UID
0 commit comments