infra/jenkins/docker/Dockerfile
2024-10-03 17:38:34 +02:00

30 lines
1.3 KiB
Docker

FROM jenkins:2.60.3
# Install docker
USER root
RUN apt-get update && apt-get install -y lsb-release
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli
ENV DOCKER_HOST=unix:///var/run/docker.sock
# Give user `jenkins` permission to use the docker daemon. The group ID of the created `docker`
# group matches with the ID of the docker group on the MMKB core server
RUN groupadd --gid 999 docker
RUN usermod -aG docker jenkins
# Import the CA Certificate needed for company GitLab into the JVM TrustStore to make it known to Jenkins
#COPY resources/SectigoRSADomainValidationSecureServerCA.pem /etc/ssl/certs/
#RUN cd $JAVA_HOME/conf/security \
# && keytool -cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias ucs-gitlab-cert -file /etc/ssl/certs/SectigoRSADomainValidationSecureServerCA.pem
# create maven repository dir and grant permissions to jenkins user so that the directory is
# writeable for jenkins jobs
RUN mkdir -p /mvn/repository && chown jenkins:jenkins /mvn/repository
USER jenkins