JenkinsDocker/Dockerfile

31 lines
1.1 KiB
Docker
Raw Normal View History

2022-11-16 18:02:27 +00:00
FROM ubuntu:20.04
2020-06-04 18:56:10 +00:00
2020-06-04 19:52:43 +00:00
LABEL maintainer="ovsyannikov.alexey95@gmail.com"
2023-12-09 15:58:17 +00:00
SHELL ["/bin/bash", "-c"]
2020-06-04 18:56:10 +00:00
USER root
2020-10-16 13:47:32 +00:00
ENV TZ=Etc/GMT
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2023-12-09 17:19:52 +00:00
RUN mv /bin/sh /bin/sh.old && ln -s /bin/bash /bin/sh
2023-12-09 17:42:54 +00:00
RUN apt update && apt -y install wget gnupg2 zip unzip curl sudo git software-properties-common pass axel
2020-06-04 18:56:10 +00:00
RUN mkdir -p /var/jenkins_home/jenkins && cd /var/jenkins_home/ &&\
2020-10-16 13:47:32 +00:00
useradd -s /bin/bash -G sudo -d /var/jenkins_home -u 1000 jenkins &&\
2020-06-04 18:56:10 +00:00
chmod 777 /tmp
2020-09-22 19:26:45 +00:00
COPY ./run /var/jenkins_home/
2021-03-12 10:23:35 +00:00
RUN chown -R jenkins:jenkins /var/jenkins_home
2020-06-04 18:56:10 +00:00
2023-12-09 17:42:54 +00:00
USER jenkins
2023-12-09 15:30:17 +00:00
RUN curl -s "https://get.sdkman.io" | bash
RUN source "$HOME/.sdkman/bin/sdkman-init.sh" &&\
2023-12-09 15:58:17 +00:00
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
2020-06-04 18:56:10 +00:00
2023-11-26 15:02:37 +00:00
RUN cd /var/jenkins_home/ && wget http://mirrors.jenkins.io/war-stable/2.426.1/jenkins.war
2023-12-09 16:22:16 +00:00
ENTRYPOINT /var/jenkins_home/run
VOLUME /var/jenkins_home/jenkins