This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
63 lines (55 loc) · 2.11 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
FROM eclipse-temurin:11-jre-alpine
LABEL maintainer "Alexander Groß <agross@therightstuff.de>"
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["teamcity-server", "run"]
EXPOSE 8111
WORKDIR /teamcity
HEALTHCHECK --start-period=2m \
CMD wget --server-response --output-document=/dev/null http://localhost:8111/login.html || exit 1
ARG VERSION=2024.03.2
ARG DOWNLOAD_URL=https://download.jetbrains.com/teamcity/TeamCity-$VERSION.tar.gz
ARG SHA_DOWNLOAD_URL=https://download.jetbrains.com/teamcity/TeamCity-$VERSION.tar.gz.sha256
RUN echo Creating teamcity user and group with static ID of 3000 && \
addgroup -g 3000 -S teamcity && \
adduser -g "JetBrains TeamCity" -S -h "$(pwd)" -u 3000 -G teamcity teamcity && \
\
echo Installing packages && \
apk add --no-cache bash \
coreutils \
ca-certificates \
git \
libressl \
openssh-client-default \
tomcat-native \
wget && \
\
echo Downloading $DOWNLOAD_URL to $(pwd) && \
wget --progress bar:force:noscroll \
"$DOWNLOAD_URL" && \
\
echo Verifying download && \
wget --progress bar:force:noscroll \
--output-document \
download.sha256 \
"$SHA_DOWNLOAD_URL" && \
\
sha256sum -c download.sha256 && \
rm download.sha256 && \
\
echo Extracting to $(pwd) && \
tar -xzvf TeamCity-$VERSION.tar.gz --directory . && \
rm TeamCity-$VERSION.tar.gz && \
mv TeamCity/* . && \
rm -r TeamCity && \
\
chown -R teamcity:teamcity . && \
chmod +x /docker-entrypoint.sh
# Allow TeamCity to retrieve the client IP and host header when running behind a proxy.
# https://confluence.jetbrains.com/display/TCD9/How+To...#HowTo...-Tomcatsettings
RUN sed --in-place --expression 's_</Host>.*$_\
<Valve className="org.apache.catalina.valves.RemoteIpValve"\n\
protocolHeader="x-forwarded-proto"\n\
remoteIpHeader="x-forwarded-for" />\n\
&_' conf/server.xml
USER teamcity