From cb364aa083171d2588d89dbeecb55ffa94cb61e8 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sat, 9 May 2020 14:46:28 +0300 Subject: [PATCH] Fixes for Dockerfile and docker-compose.yml --- docker-compose.yml | 2 +- jenkins/Dockerfile | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index da08cc8..b30d73b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: # https://jenkins.io/doc/book/blueocean/ jenkins: build: - dockerfile: ./jenkins/Dockerfile + dockerfile: ./Dockerfile context: ./jenkins args: HOST_DOCKER_VERSION: ${HOST_DOCKER_VERSION:-19.03.5} diff --git a/jenkins/Dockerfile b/jenkins/Dockerfile index ab9330f..e60fbfa 100644 --- a/jenkins/Dockerfile +++ b/jenkins/Dockerfile @@ -12,11 +12,20 @@ RUN chown -R jenkins:jenkins /var/cache/jenkins # Installs docker inside container # ATENTION: version MUST be the same as host's docker installation! ARG HOST_DOCKER_VERSION -ENV VERSION=$HOST_DOCKER_VERSION -RUN curl -fsSL https://get.docker.com -o get-docker.sh | sh +RUN apt update && apt install -y \ + 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 -RUN apt update RUN apt install -y build-essential # 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 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 COPY jobs/. /var/jenkins_home/jobs/