-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (33 loc) · 1.22 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
FROM sonarsource/sonar-scanner-cli:4.7 as sonars
FROM maven:3.8.6-eclipse-temurin-11 as maven
FROM atlassian/bamboo-agent-base:8.2.1 as ship
# Install and configure as ROOT
USER root
### Copy secrets
COPY secrets /etc/secrets
RUN chmod a+wr /etc/secrets
### Copy scripts
COPY scripts /scripts
RUN chmod a+wrx -R /scripts/*.sh # Required due to permission loss on Windows
#### Install using scripts
RUN /scripts/install.all.sh
#### Configure using scripts
RUN /scripts/config.all.sh
# Overwrite entrypoint command to start services before bamboo agent
COPY entrypoint.sh /entrypoint.sh
RUN chmod a+wrx /entrypoint.sh
CMD ["/entrypoint.sh"]
### Install maven
ARG MVN_HOME=/usr/share/maven
COPY --from=maven ${MVN_HOME} ${MVN_HOME}
RUN ln -s ${MVN_HOME} /opt/maven
### Install Sonar Scanner
ARG SONAR_DIR=/opt/sonar-scanner
COPY --from=sonars ${SONAR_DIR} ${SONAR_DIR}
ENV SONAR_SCANNER_HOME ${SONAR_DIR}
# Update capabilities as RUN_USER
USER ${RUN_USER}
RUN /bamboo-update-capability.sh "system.builder.mvn3.Maven 3.8.6" /usr/share/maven \
&& /bamboo-update-capability.sh "system.git.executable" /usr/bin/git \
&& /bamboo-update-capability.sh "Docker" /usr/bin/docker \
&& /bamboo-update-capability.sh "system.builder.sos" ${SONAR_DIR}