Jack Moore

Email: jack(at)jmoore53.com
Project Updates

Multi-Stage Image Builds

08 Aug 2019 » containers, docker, commandcenter

Pipelines are one of my favorite devops tools. All technical debt must be eliminated. This goes for deploys!


Running Jenkins from a Docker container is a little weird to think about, but it provides a hypothetical build environment for you to test deploys and commits to jenkins in the cloud without spending minutes or money on a cloud provider.

Dockerception Dockerfile

FROM jenkins/jenkins:lts

USER root
RUN apt-get update -qq \
    && apt-get install -qqy apt-transport-https ca-certificates curl gnupg2 software-properties-common 
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
RUN apt-get update  -qq \
    && apt-get install docker-ce=17.12.1~ce-0~debian -y
RUN usermod -aG docker jenkins

Build Dockerception

docker build -t jenkins_image -f ./local_jenkins.Dockerfile .

Create Dockerception

docker run -p 8080:8080 -p 50000:50000 \
    -v jenkins_home:/var/jenkins_home \
    -v "$(pwd):/var/project" \
    -v $(which docker):/usr/local/bin/docker \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --name jenkins jenkins_image

Start Dockerception

docker build -t jenkins_image -f ./local_jenkins.Dockerfile .
docker run -p 3000:3000 --name compositional cc/builder_prod

Once Started

Find the password in the logs or in the STDOUT on the console.

Setting Up With Docker

Configure the jenkins by building first, creating and then starting.


Setup Git Repo: file:///var/project

Add MASTER_KEY credentials

© Jack Moore