jenkins-with-docker/Dockerfile

28 lines
840 B
Docker

FROM jenkins/jenkins
USER root
RUN groupadd -g 281 docker
RUN usermod -aG docker jenkins
RUN apt-get update
RUN apt-get install -y\
ca-certificates \
curl \
gnupg
RUN mkdir -m 0755 -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update
RUN apt-get install -y docker-ce-cli
COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy
USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean docker-workflow"