Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Add information for default capabilities provided from the base image
  • Loading branch information
AlexanderB1290 authored Oct 24, 2022
1 parent d3c212c commit b4e0746
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,41 @@ 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
##### Install and configure as ROOT
USER root

### Copy secrets
# 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
# Install using scripts
RUN /scripts/install.all.sh
#### Configure using scripts
# 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
#### Install maven
ENV MAVEN_HOME=/usr/share/maven
COPY --from=maven /usr/share/maven ${MAVEN_HOME}
RUN ln -s ${MAVEN_HOME} /opt/maven

### Install Sonar Scanner
#### Install Sonar Scanner
ENV SONAR_SCANNER_HOME /opt/sonar-scanner
COPY --from=sonars /opt/sonar-scanner ${SONAR_SCANNER_HOME}

# Update capabilities as RUN_USER
#### Update capabilities as RUN_USER
# Atlassian bamboo base image comes with capabilities:
# - "system.jdk.JDK 1.11" ${JAVA_HOME}/bin/java
# - "Python" /usr/bin/python3
# - "Python 3" /usr/bin/python3
# - "Git" /usr/bin/git # NOTE: not set on correct capability in the base image, thus setting it here
USER ${RUN_USER}
RUN /bamboo-update-capability.sh "system.builder.mvn3.Maven 3" ${MAVEN_HOME} \
&& /bamboo-update-capability.sh "system.git.executable" /usr/bin/git \
Expand Down

0 comments on commit b4e0746

Please sign in to comment.