From b195a41bc7bf46fe3f997fb31ef3ff639f3158ce Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 9 Dec 2023 21:58:17 +0600 Subject: [PATCH] several optimizations --- Dockerfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73f19f6..9cf4b08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,28 +2,33 @@ FROM ubuntu:20.04 LABEL maintainer="ovsyannikov.alexey95@gmail.com" +SHELL ["/bin/bash", "-c"] +ENTRYPOINT /var/jenkins_home/run +VOLUME /var/jenkins_home/jenkins + USER root ENV TZ=Etc/GMT RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt update && apt -y install wget gnupg2 zip unzip curl sudo git software-properties-common pass axel +RUN apt update && apt -y install wget gnupg2 zip unzip curl sudo git RUN mkdir -p /var/jenkins_home/jenkins && cd /var/jenkins_home/ &&\ useradd -s /bin/bash -G sudo -d /var/jenkins_home -u 1000 jenkins &&\ chmod 777 /tmp - -ENTRYPOINT /var/jenkins_home/run COPY ./run /var/jenkins_home/ RUN chown -R jenkins:jenkins /var/jenkins_home -USER jenkins - -SHELL ["/bin/bash", "-c"] +USER 1000 RUN curl -s "https://get.sdkman.io" | bash RUN source "$HOME/.sdkman/bin/sdkman-init.sh" &&\ - sdk install java `sdk ls java | grep librca | grep " 17" | grep -m 1 -Eo "(.?[0-9]{1,2}){3}" | head -1`-librca + sdk install java `sdk ls java | grep librca | grep " 17" | grep -m 1 -Eo "(.?[0-9]{1,2}){3}" | head -1`-librca &&\ + sdk default java `sdk ls java | grep librca | grep " 17" | grep -m 1 -Eo "(.?[0-9]{1,2}){3}" | head -1`-librca -VOLUME /var/jenkins_home/jenkins +USER root + +RUN apt update && apt -y install software-properties-common pass axel + +USER jenkins RUN cd /var/jenkins_home/ && wget http://mirrors.jenkins.io/war-stable/2.426.1/jenkins.war