Skip to content

Instantly share code, notes, and snippets.

@ghalusa
Last active October 3, 2020 01:37
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 ghalusa/f67b298595f6e85eb6c678c1f2be2e85 to your computer and use it in GitHub Desktop.
Save ghalusa/f67b298595f6e85eb6c678c1f2be2e85 to your computer and use it in GitHub Desktop.
Set Up a Jenkins Environment using Docker

Jenkins Environment using Docker

See: https://medium.com/@Joachim8675309/jenkins-environment-using-docker-6a12603ebf9

Quick Start (in a nutshell)

Create a directory along with the docker-compose.yml file

mkdir jenkins && cd jenkins/
vim docker-compose.yml

Copy/paste into the docker-compose.yml file and save

version: "2"
services:
  jenkins:
    image: jenkinsci/blueocean
    user: root
    ports:
      - "8080:8080"
      - "8443:8443"
      - "50000:50000"
    volumes:
      - ./jenkins_data:/var/jenkins_home
      ##### Mac OS X and Linux ONLY #####
      - /var/run/docker.sock:/var/run/docker.sock

Install and start the container

docker-compose up -d

Take note of the auto-generated admin password which is displayed during install.

This is just an example of said output:

jenkins_1  | Jenkins initial setup is required. An admin user has been created and a password generated.
jenkins_1  | Please use the following password to proceed to installation:
jenkins_1  |
jenkins_1  | 8b4d313f85674544b695394c40e1be43

Setup/Login via browser using the auto-generated admin password

http://127.0.0.1:8080/

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