forked from sjoerdmulder/teamcity-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (26 loc) · 1.5 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
FROM java:8
MAINTAINER Roland Berger <[email protected]>
# Depending on the postgres version you want to run you should change the jdbc driver name. See here for more information https://jdbc.postgresql.org/download.html
ENV POSTGRES_JDBC_DRIVER postgresql-9.4.1207.jar
ENV TEAMCITY_VERSION 9.1.5
ENV TEAMCITY_DATA_PATH /var/lib/teamcity
ENV TEAMCITY_USER teamcity
# grab gosu for easy step-down from root
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
RUN curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu
# add user
RUN adduser --disabled-password --gecos '' $TEAMCITY_USER
# && adduser $AGENT_USER sudo \
# && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Get and install teamcity
RUN curl -L https://download.jetbrains.com/teamcity/TeamCity-$TEAMCITY_VERSION.tar.gz | tar xz -C /opt
# Enable the correct Valve when running behind a proxy
RUN sed -i -e "s/\.*<\/Host>.*$/<Valve className=\"org.apache.catalina.valves.RemoteIpValve\" protocolHeader=\"x-forwarded-proto\" \/><\/Host>/" /opt/TeamCity/conf/server.xml
COPY docker-entrypoint.sh /docker-entrypoint.sh
VOLUME /var/lib/teamcity
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 8111