Browse Source

Fixes for Dockerfile and docker-compose.yml

master
Apostolos Fanakis 5 years ago
parent
commit
cb364aa083
  1. 2
      docker-compose.yml
  2. 18
      jenkins/Dockerfile

2
docker-compose.yml

@ -58,7 +58,7 @@ services:
# https://jenkins.io/doc/book/blueocean/ # https://jenkins.io/doc/book/blueocean/
jenkins: jenkins:
build: build:
dockerfile: ./jenkins/Dockerfile dockerfile: ./Dockerfile
context: ./jenkins context: ./jenkins
args: args:
HOST_DOCKER_VERSION: ${HOST_DOCKER_VERSION:-19.03.5} HOST_DOCKER_VERSION: ${HOST_DOCKER_VERSION:-19.03.5}

18
jenkins/Dockerfile

@ -12,11 +12,20 @@ RUN chown -R jenkins:jenkins /var/cache/jenkins
# Installs docker inside container # Installs docker inside container
# ATENTION: version MUST be the same as host's docker installation! # ATENTION: version MUST be the same as host's docker installation!
ARG HOST_DOCKER_VERSION ARG HOST_DOCKER_VERSION
ENV VERSION=$HOST_DOCKER_VERSION RUN apt update && apt install -y \
RUN curl -fsSL https://get.docker.com -o get-docker.sh | sh apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
RUN sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN apt update && apt install "docker-ce=$HOST_DOCKER_VERSION" "docker-ce-cli=$HOST_DOCKER_VERSION"
# Installs tools needed when installing npm packages # Installs tools needed when installing npm packages
RUN apt update
RUN apt install -y build-essential RUN apt install -y build-essential
# Generates an SSH key-pair to use with Gitlab # Generates an SSH key-pair to use with Gitlab
@ -33,9 +42,6 @@ COPY configuration/* /var/jenkins_home/init.groovy.d/
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
# Adds scripts for tool installation
COPY groovy/* /usr/share/jenkins/ref/init.groovy.d/
# Adds job configurations for apella # Adds job configurations for apella
COPY jobs/. /var/jenkins_home/jobs/ COPY jobs/. /var/jenkins_home/jobs/

Loading…
Cancel
Save