표준 프로세스는 업스트림 이미지를 확장하는 것입니다. 업스트림 프로젝트에서 Dockerfile을 가져 와서 직접 수정할 필요가 있습니다. 처음부터 모든 것을 빌드해야하는 회사 정책이 있거나 Dockerfile을 확장하여 수정할 수없는 잘못된 업스트림입니다 (예 : Dockerfile의 볼륨). 확장 이유는 Dockerfile에 변경 사항을 다시 적용하지 않고 상향 이미지를 가져 와서 하위 이미지를 재구성하여 최신 패치를 쉽게 얻을 수 있기 때문입니다.
Docker 허브의 "공식적인"젠킨스 이미지가 몇 번 이동했습니다. 그것은 jenkinsci/jenkins였습니다. 그런 다음 jenkins로 공식 라이브러리로 옮겼습니다 : 최신, 이제 jenkins/jenkins : lts로 옮깁니다. 당신이 상류 이미지를 확장하는 것입니다 방법의 예는 다음과 같은 것입니다 :
FROM jenkins/jenkins:lts
ARG GOSU_VERSION=1.10
# switch to root, let the entrypoint drop back to jenkins
USER root
# install debian packages, gosu, and docker
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
vim \
wget \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
&& curl -sSL https://get.docker.com/ | sh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# entrypoint is used to update docker gid and revert back to jenkins user
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
내가 내 github의의의 repo이 예제의 나머지 부분을 가지고 : https://github.com/bmitch3020/jenkins-docker
https://www.youtube. com/watch? v = r5cofUYqnn8, 젠킨스의 전체 그림. 군중 모드에서. –