Skip to content

Instantly share code, notes, and snippets.

@naturalett
Last active January 6, 2024 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naturalett/00e35f1d28e5efa36db11f2918fae7db to your computer and use it in GitHub Desktop.
Save naturalett/00e35f1d28e5efa36db11f2918fae7db to your computer and use it in GitHub Desktop.
Jenkins with docker engine
FROM jenkins/jenkins:2.387-jdk11
# ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
RUN jenkins-plugin-cli --plugins \
workflow-aggregator:596.v8c21c963d92d \
git:5.0.2 \
docker-workflow:563.vd5d2e5c4007f \
docker-plugin:1.3.0
USER root
# Install Docker from official repo
RUN apt-get update -qq && \
apt-get install -qqy apt-transport-https ca-certificates curl gnupg2 software-properties-common && \
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
apt-key fingerprint 0EBFCD88 && \
add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian $(lsb_release -cs) stable" && \
apt-get update -qq && \
apt-get install -qqy docker-ce && \
usermod -aG docker jenkins && \
chown -R jenkins:jenkins $JENKINS_HOME/
RUN chmod 777 /var/run/
USER jenkins
VOLUME [$JENKINS_HOME, "/var/run/docker.sock"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment