Skip to content

Instantly share code, notes, and snippets.

@nidin
Last active July 20, 2016 15:07
Show Gist options
  • Save nidin/dc91cb86f0a737bfbc6a0bd5c50c4f56 to your computer and use it in GitHub Desktop.
Save nidin/dc91cb86f0a737bfbc6a0bd5c50c4f56 to your computer and use it in GitHub Desktop.
Mount Ubuntu Host Docker to Official Jenkins Container
FROM jenkins
USER root
RUN apt-get update \
&& apt-get install -y sudo apt-transport-https ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN echo "www-data ALL=NOPASSWD: ALL" >> /etc/sudoers
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
RUN apt-get update
RUN apt-get install -y docker-engine libsystemd-journal0 python-pip
RUN pip install docker-compose
RUN service docker start
docker run --name jenkins -u www-data -p 8080:8080 -p 50000:50000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/app/jenkins:/var/jenkins_home \
-v /var/www:/var/www \
-d jenkins_docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment