-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (26 loc) · 1.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# latest alpine, others: jdk11, lts, slim, centos
# https://jenkins.io/download/lts/
# https://hub.docker.com/r/jenkins/jenkins/tags
#FROM jenkins/jenkins:2.176.2-alpine
FROM jenkins/jenkins:2.193-centos
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
ENV BITBUCKET_HOST bitbucket.imp.ac.at
# set plugins dir outsite home, which will be volume
# ENV JENKINS_OPTS
# this seems broken in combination with --volume from commandline
# VOLUME /var/jenkins_home/
ADD https://cache.agilebits.com/dist/1P/op/pkg/v0.5.7/op_linux_amd64_v0.5.7.zip /tmp
USER root
RUN unzip /tmp/op_linux_amd64_v0.5.7.zip op -d /usr/local/bin/
USER jenkins
# groovy init scripts, must be in JENKINS_HOME
COPY init.groovy.d/ /usr/share/jenkins/ref/init.groovy.d/
# config file for bootstrapping credentials setup
COPY initial_credentials.yaml /usr/share/jenkins/ref/
# Jenkins config as code (JCasC) setup
ENV CASC_JENKINS_CONFIG /usr/share/jenkins/jenkins.conf.d/
COPY jenkins.conf.d/ /usr/share/jenkins/jenkins.conf.d/
# prepare ssh config
RUN umask 077 && mkdir -m 0700 /usr/share/jenkins/ref/.ssh && touch /usr/share/jenkins/ref/.ssh/known_hosts
# && ssh-keyscan -H ${BITBUCKET_HOST}:7999 >> /usr/share/jenkins/ref/.ssh/known_hosts