From f93b715dde9ea11ba61a847411694ab278551033 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Mon, 11 Jul 2022 12:56:04 +0000 Subject: [PATCH] fix: create XDG_RUNTIME if workspace is mounted --- Dockerfile | 5 +++-- entrypoint.sh | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 586c34f..ca43285 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ ADD --chown=$USER:$USER html.tpl /home/$USER # Rootless podman RUN mkdir -p /home/$USER/.config/containers +ADD entrypoint.sh /usr/local/bin/entrypoint.sh ADD --chown=$USER:$USER conf/containers.conf conf/registries.conf conf/storage.conf /home/$USER/.config/containers RUN echo -e "$USER:1:999\n$USER:1001:64535" > /etc/subuid && \ @@ -36,10 +37,10 @@ RUN echo -e "$USER:1:999\n$USER:1001:64535" > /etc/subuid && \ # 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/$USER/agent +ENV XDG_RUNTIME_DIR=/home/$USER/agent/xdg-run ENV _CONTAINERS_USERNS_CONFIGURED="" ENV TRIVY_TEMPLATE="@/home/jenkins/html.tpl" USER $USER -ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-agent"] +ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..e44e937 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p $HOME/agent/xdg-run +/usr/local/bin/jenkins-agent