-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
50 lines (41 loc) · 2.42 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
FROM openjdk:8-alpine
# Setup useful environment variables
ENV BAMBOO_HOME /var/atlassian/bamboo
ENV BAMBOO_INSTALL /opt/atlassian/bamboo
ENV BAMBOO_VERSION 6.8.0
# Install Atlassian Bamboo and helper tools and setup initial home
# directory structure.
RUN set -x \
&& addgroup -S bamboo \
&& adduser -S -h "${BAMBOO_HOME}" bamboo bamboo \
&& apk add --no-cache curl xmlstarlet git openssh bash ttf-dejavu libc6-compat tzdata \
&& mkdir -p "${BAMBOO_HOME}/lib" \
&& chmod -R 700 "${BAMBOO_HOME}" \
&& chown -R bamboo:bamboo "${BAMBOO_HOME}" \
&& mkdir -p "${BAMBOO_INSTALL}" \
&& curl -Ls "https://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-${BAMBOO_VERSION}.tar.gz" | tar -zx --directory "${BAMBOO_INSTALL}" --strip-components=1 --no-same-owner \
&& curl -Ls "https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.tar.gz" | tar -xz --directory "${BAMBOO_INSTALL}/lib" --strip-components=1 --no-same-owner "mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar" \
&& chmod -R 700 "${BAMBOO_INSTALL}" \
&& chown -R bamboo:bamboo "${BAMBOO_INSTALL}" \
&& sed --in-place 's/^# umask 0027$/umask 0027/g' "${BAMBOO_INSTALL}/bin/setenv.sh" \
&& xmlstarlet ed --inplace \
--delete "Server/Service/Engine/Host/@xmlValidation" \
--delete "Server/Service/Engine/Host/@xmlNamespaceAware" \
"${BAMBOO_INSTALL}/conf/server.xml" \
&& touch -d "@0" "${BAMBOO_INSTALL}/conf/server.xml"
# Use the default unprivileged account. This could be considered bad practice
# on systems where multiple processes end up being executed by 'daemon' but
# here we only ever run one process anyway.
USER bamboo:bamboo
# Expose default HTTP and SSH ports.
EXPOSE 8085 54663
# Set volume mount points for installation and home directory. Changes to the
# home directory needs to be persisted as well as parts of the installation
# directory due to eg. logs.
VOLUME ["/var/atlassian/bamboo","/opt/atlassian/bamboo/logs"]
# Set the default working directory as the Bamboo home directory.
WORKDIR /var/atlassian/bamboo
COPY "docker-entrypoint.sh" "/"
ENTRYPOINT ["/docker-entrypoint.sh"]
# Run Atlassian Bamboo as a foreground process by default.
CMD ["/opt/atlassian/bamboo/bin/start-bamboo.sh", "-fg"]