Compare commits

...

2 Commits

Author SHA1 Message Date
Schneider Roland
cba6c6c8a0 add jenkin dockerfile 2024-10-03 17:43:45 +02:00
Schneider Roland
4a87a616ae add jenkin dockerfile 2024-10-03 17:38:34 +02:00
4 changed files with 48 additions and 2 deletions

View File

@ -1,11 +1,18 @@
services: services:
jenkins: jenkins:
image: jenkins/jenkins:lts image: nexus.rschneider.hu/repo1/infra/jenkins:1.0.1
restart: always
ports: ports:
- "8080:8080" - "4112:8080"
volumes: volumes:
- jenkins_home:/var/jenkins_home - jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- mvn_repository:/mvn/repository
ssh-agent: ssh-agent:
image: jenkins/ssh-agent image: jenkins/ssh-agent
volumes: volumes:
jenkins_home: jenkins_home:
mvn_repository:

View File

@ -0,0 +1,29 @@
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

View File

@ -0,0 +1,9 @@
#!/bin/sh
CURRENT_DIR=$(dirname "$0")
DOCKER_CONTEXT_DIR=$(readlink -f "$CURRENT_DIR/..");
tag="nexus.rschneider.hu/repo1/infra/jenkins:1.0.1"
docker build --tag $tag . \
&& docker push $tag

View File

@ -18,3 +18,4 @@ router redirects port range 4100-4200 to the infra server
| 4109 | nexus | admin web | | 4109 | nexus | admin web |
| 4110 | nexus | docker registry | | 4110 | nexus | docker registry |
| 4111 | vaultwarden | web | | 4111 | vaultwarden | web |
| 4112 | jenkins | jenkins |