From 99184b8c19cbe70b08ca8ab339685bf8b0b7d17d Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Wed, 2 Jan 2019 10:08:53 -0700 Subject: Initial commit of working files --- .gitignore | 2 ++ Dockerfile | 23 +++++++++++++++++++++++ Makefile | 17 +++++++++++++++++ docker-compose.yml | 16 ++++++++++++++++ jenkins_home/.gitkeep | 0 5 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 docker-compose.yml create mode 100644 jenkins_home/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30ac96b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +jenkins_home/* +!jenkins_home/.gitkeep diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f20433e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM jenkins/jenkins:lts + +USER root + +RUN apt-get update && apt-get -y install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg2 \ + software-properties-common && \ + curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \ + add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ + $(lsb_release -cs) \ + stable" && \ + apt-get update && \ + apt-get -y install docker-ce + +RUN apt-get install -y docker-ce + +RUN usermod -a -G docker jenkins + +USER jenkins diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d5d2099 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +build: ## Build the Docker image + docker-compose -p jenkins_docker build + +up: build ## Bring the container up + docker-compose -p jenkins_docker up -d + +down: ## Stop the container + docker-compose -p jenkins_docker stop + +enter: ## Enter the running container + docker-compose -p jenkins_docker exec backend /bin/bash + +clean: down ## Remove stoped containers + docker-compose -p jenkins_docker rm diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..944f856 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3' +services: + backend: + build: ./ + network_mode: "bridge" + container_name: jenkins_docker + image: thornycrackers/jenkins_docker + ports: + - "8000" + - "50000" + volumes: + - ./jenkins_home:/var/jenkins_home + - /var/run/docker.sock:/var/run/docker.sock + command: /bin/bash + tty: true + stdin_open: true diff --git a/jenkins_home/.gitkeep b/jenkins_home/.gitkeep new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3