BuildEnvironments/Jenkins/Dockerfile
2025-06-11 23:18:22 -07:00

31 lines
906 B
Docker

FROM git.zontreck.com/packages/debian:build
RUN apt-get update
RUN apt install -y wget apt-transport-https gpg && apt-get clean -y
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y temurin-21-jdk curl wget moreutils && apt-get clean -y
ENV JENKINS_VERSION 2.514
USER root
WORKDIR /
RUN wget "https://get.jenkins.io/war/$JENKINS_VERSION/jenkins.war"
# Add a user ID 1000:1000
RUN useradd -m -s /bin/bash fakeuser
# Jenkins expects ID 1001:1001
RUN useradd -m -s /bin/bash -d /jenkins jenkins
USER jenkins
WORKDIR /jenkins
ENTRYPOINT ["java", "-jar", "/jenkins.war"]