jenkins-podman/Dockerfile

51 lines
1.6 KiB
Docker
Raw Normal View History

# https://github.com/containers/podman/blob/main/contrib/podmanimage/stable/Containerfile
# https://hub.docker.com/r/jenkins/inbound-agent/tags
2022-01-13 11:41:17 +00:00
FROM jenkins/inbound-agent:alpine-jdk17@sha256:4f78d4832acacddf3573b1095770f672ac0b2a76432002f9ade707e302f96a12
2022-01-13 11:41:17 +00:00
ARG BUILDUSER=jenkins
2022-06-27 17:16:02 +00:00
2022-01-13 11:41:17 +00:00
USER root
RUN echo "@edge-testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk upgrade -U --available --no-cache && \
apk add --no-cache \
tini \
make \
2023-08-08 11:06:05 +00:00
jq \
yq \
strace \
2023-10-02 11:20:48 +00:00
fuse-overlayfs \
podman \
buildah \
2023-08-11 12:31:24 +00:00
py-boto3 \
aws-cli \
trivy@edge-testing
2022-01-13 11:41:17 +00:00
2022-01-14 00:23:18 +00:00
# Trivy html template
ADD --chown=$BUILDUSER:$BUILDUSER html.tpl /home/$BUILDUSER
2022-01-14 00:23:18 +00:00
# Rootless podman
RUN mkdir -p /home/$BUILDUSER/.config/containers
2022-06-27 17:16:02 +00:00
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
# conf/registries.conf will be mounted RO at runtime to inherit worker settings incl. caching proxies
ADD --chown=$BUILDUSER:$BUILDUSER conf/containers.conf conf/storage.conf /home/$BUILDUSER/.config/containers
2022-01-13 11:41:17 +00:00
RUN echo -e "$BUILDUSER:1:999\n$BUILDUSER:1001:64535" > /etc/subuid && \
echo -e "$BUILDUSER:1:999\n$BUILDUSER:1001:64535" > /etc/subgid && \
2022-07-11 11:47:24 +00:00
cd /usr/bin && ln -s podman docker && \
chown $BUILDUSER:$BUILDUSER -R /home/$BUILDUSER
2022-01-13 11:41:17 +00:00
# Patch jenkins-agent to launch podman service
RUN sed -i -e 's/exec \$JAVA_BIN/podman system service -t0\&\n exec \$JAVA_BIN/' /usr/local/bin/jenkins-agent
ENV XDG_RUNTIME_DIR=/home/$BUILDUSER/agent/xdg-run
2022-07-11 13:31:03 +00:00
ENV BUILDAH_ISOLATION=chroot
2022-06-27 17:16:02 +00:00
ENV _CONTAINERS_USERNS_CONFIGURED=""
2022-11-18 13:15:08 +00:00
ENV HOME=/home/$BUILDUSER
2022-01-14 00:23:18 +00:00
USER $BUILDUSER
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]