-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
162 lines (143 loc) · 5.15 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
####DOCKER FILE FOR IMAGE OF TEI JENKINS SERVER####
# Written by Martin Holmes, December 2016. #
# As the Jenkins page says, the image should be started like
# this:
# docker run --name teijenkins -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins
# thus storing all jenkins data in /your/home, or like this:
# docker run --name teijenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins
# My own version for the record:
# docker run --name teijenkins -p 8080:8080 -p 50000:50000 -v /home/mholmes/WorkData/tei/jenkins_home:/var/jenkins_home jenkins
# IMPORTANT NOTE: If you run this container, the VERY FIRST thing you should do is to
# configure security in Jenkins. Out of the box, it allows anyone
# to run any job without any login. DO NOT FORGET TO DO THIS.
FROM jenkins/jenkins:lts
LABEL org.opencontainers.image.authors="Martin Holmes and Peter Stadler for the TEI Council"
LABEL org.opencontainers.image.source="https://github.com/TEIC/Jenkins"
# Variables we'll use later on.
ARG JENKINS_USER_NAME="TEI Council"
ARG JENKINS_USER_EMAIL="tei-council@lists.tei-c.org"
# set environment variables
# see https://github.com/TEIC/Jenkins/issues/12
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# Need to switch to root user to install stuff.
USER root
# Install a bunch of packages we need. This package list has been
# customized a little from the original 2016 builder script set,
# because we're working with Debian Jessie instead of Ubuntu.
# Many required packages are already installed upstream.
# Various tex-related packages have been added as build failures
# revealed the need for them.
RUN apt-get update && apt-get -y --no-install-recommends --no-install-suggests install \
ant \
ant-optional \
ant-contrib \
asciidoc \
autotools-dev \
build-essential \
debhelper \
debiandoc-sgml \
devscripts \
docbook-xml \
docbook-xsl \
fakeroot \
fonts-linuxlibertine \
# provides Noto font families for Traditional Chinese, Simplified Chinese, Japanese and Korean, see https://packages.debian.org/buster/fonts-noto-cjk
fonts-dejavu \
fonts-noto-cjk \
jing \
libcss-dom-perl \
libexpat-dev \
libfile-fcntllock-perl \
libjing-java \
libsaxon-java \
libsaxonhe-java \
libterm-readkey-perl \
libtrang-java \
libwww-perl \
libxml2-utils \
tidy \
linuxdoc-tools \
lmodern \
make \
maven \
perl-modules \
psgml \
texlive-fonts-recommended \
texlive-plain-generic \
texlive-latex-extra \
texlive-xetex \
trang \
xmlstarlet \
xsltproc \
zip \
&& apt-get -y dist-upgrade \
&& echo 'APT::Default-Release "bookworm";' > /etc/apt/apt.conf.d/default-release \
&& echo "deb http://deb.debian.org/debian/ testing main" > /etc/apt/sources.list.d/testing.list \
&& apt update \
&& apt-get -y --no-install-recommends --no-install-suggests install fonts-junicode/testing \
&& rm -rf /var/lib/apt/lists/*
# Building `rnv` locally since it's no
# longer packaged for Debian
RUN mkdir -p /var/rnv && \
git clone https://github.com/hartwork/rnv.git /var/rnv && \
cd /var/rnv && \
./bootstrap && \
./configure && \
make && \
make install
# Install W3C linkchecker skript "checklink"
# https://dev.w3.org/perl/modules/W3C/LinkChecker/docs/checklink
RUN PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install W3C::LinkChecker'
# create a simple shell wrapper script for the
# saxon.jar provided by the Debian libsaxonhe-java package
RUN echo "#! /bin/bash" > /usr/local/bin/saxon \
&& echo "java -jar /usr/share/java/Saxon-HE.jar \$*" >> /usr/local/bin/saxon \
&& chmod 755 /usr/local/bin/saxon
# running as user jenkins for installing plugins,
# and finally starting the service
# (removed scp plugin due to "Insecure credential storage and transmission" warning)
USER jenkins:jenkins
WORKDIR ${JENKINS_HOME}
RUN jenkins-plugin-cli --plugins \
junit \
script-security \
matrix-project \
structs \
ssh-credentials \
workflow-scm-step \
workflow-step-api \
maven-plugin \
javadoc \
display-url-api \
mailer \
plain-credentials \
token-macro \
credentials \
git \
git-client \
copyartifact \
emotional-jenkins-plugin \
jobConfigHistory \
plot \
log-parser \
PrioritySorter \
scm-api \
github \
github-api \
cors-filter \
build-symlink
# copy the initial job configuration and log parse rules to /tmp
# for convenience, we tar it and copy it to /usr/share/jenkins/ref/
# in the next step, so it will be added the ${JENKINS_HOME} directory automatically
COPY jobs /tmp/jobs
COPY tei-log-parse-rules /tmp/tei-log-parse-rules
# Configure settings for git
# and save it for reuse
# because ${JENKINS_HOME} is declared as a volume
# and its content won't survive
RUN git config --global user.email ${JENKINS_USER_EMAIL} \
&& git config --global user.name ${JENKINS_USER_NAME} \
&& cp .gitconfig /usr/share/jenkins/ref/ \
&& tar cfz /usr/share/jenkins/ref/jobs.tar.gz -C /tmp/ jobs tei-log-parse-rules
# That should be it.