fix: create XDG_RUNTIME if workspace is mounted
This commit is contained in:
parent
664f10daf2
commit
f93b715dde
@ -26,6 +26,7 @@ ADD --chown=$USER:$USER html.tpl /home/$USER
|
|||||||
# Rootless podman
|
# Rootless podman
|
||||||
RUN mkdir -p /home/$USER/.config/containers
|
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
|
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 && \
|
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
|
# 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
|
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 _CONTAINERS_USERNS_CONFIGURED=""
|
||||||
ENV TRIVY_TEMPLATE="@/home/jenkins/html.tpl"
|
ENV TRIVY_TEMPLATE="@/home/jenkins/html.tpl"
|
||||||
|
|
||||||
USER $USER
|
USER $USER
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins-agent"]
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]
|
||||||
|
4
entrypoint.sh
Executable file
4
entrypoint.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p $HOME/agent/xdg-run
|
||||||
|
/usr/local/bin/jenkins-agent
|
Loading…
Reference in New Issue
Block a user