mirror of
https://github.com/LamGC/jenkins-agent-with-docker.git
synced 2025-07-01 12:57:25 +00:00
修复容器内的 jenkins 用户无法加入 docker 用户组的问题。 (#2)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user