修复容器内的 jenkins 用户无法加入 docker 用户组的问题。 (#2)

This commit is contained in:
2023-03-28 00:46:48 +08:00
committed by GitHub
parent 2f5c99e4b7
commit bd0799561f
2 changed files with 30 additions and 3 deletions

View File

@ -4,7 +4,9 @@ FROM jenkins/inbound-agent:${BASE_TAG}
USER root
RUN groupadd -g 987 docker && usermod -aG docker jenkins
COPY start-agent.sh /usr/local/bin/start.sh
RUN chmod 755 /usr/local/bin/start.sh
ENTRYPOINT [ "/bin/bash", "/usr/local/bin/start.sh" ]
RUN apt-get update && apt-get install -y \
ca-certificates \
@ -16,5 +18,4 @@ RUN apt-get update && apt-get install -y \
apt-get update && apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin && \
apt-get clean && rm -rf /var/lib/apt/lists/*
USER jenkins
ENV DOCKER_HOST=unix:///var/run/docker.sock