Skip to content

Instantly share code, notes, and snippets.

@Rosaniline
Created August 11, 2018 07:43
Show Gist options
  • Save Rosaniline/b5ffc293888240159f83ec3e2caa0996 to your computer and use it in GitHub Desktop.
Save Rosaniline/b5ffc293888240159f83ec3e2caa0996 to your computer and use it in GitHub Desktop.
Jenkins with docker installed
FROM jenkins/jenkins:lts
USER root
RUN apt-get update
RUN apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN apt-key fingerprint 0EBFCD88
RUN add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt-get update
RUN apt-get install -y docker-ce
USER ${user}
@Rosaniline
Copy link
Author

Rosaniline commented Aug 11, 2018

docker build -t jenkins_docker . && docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 --name jenkins jenkins_docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment