Skip to content

Commit

Permalink
#958: Remove group assignment during container build
Browse files Browse the repository at this point in the history
The sonarqube images no longer create a sonarqube group for the
sonarqube user to be placed into, instead they put the sonarqube user in
the root group. To prevent the plugin builds failing when attempting to
set the plugin ownership to a group that doesn't exist, the `chown`
command is being altered to only set the user ownership, not the
associated group.
  • Loading branch information
mc1arke committed Sep 7, 2024
1 parent 0648ca4 commit fde1c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ARG SONARQUBE_VERSION

FROM gradle:8.9-jdk17-jammy as builder
FROM gradle:8.9-jdk17-jammy AS builder

COPY . /home/build/project
WORKDIR /home/build/project
RUN gradle build -x test

FROM sonarqube:${SONARQUBE_VERSION}
COPY --from=builder --chown=sonarqube:sonarqube /home/build/project/build/libs/sonarqube-community-branch-plugin-*.jar /opt/sonarqube/extensions/plugins/
COPY --from=builder --chown=sonarqube /home/build/project/build/libs/sonarqube-community-branch-plugin-*.jar /opt/sonarqube/extensions/plugins/

ARG PLUGIN_VERSION
ENV PLUGIN_VERSION=${PLUGIN_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion release.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM sonarqube:${SONARQUBE_VERSION}
ARG PLUGIN_VERSION
ENV PLUGIN_VERSION=${PLUGIN_VERSION}

ADD --chown=sonarqube:sonarqube https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${PLUGIN_VERSION}/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar /opt/sonarqube/extensions/plugins/
ADD --chown=sonarqube https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/${PLUGIN_VERSION}/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar /opt/sonarqube/extensions/plugins/

ENV SONAR_WEB_JAVAADDITIONALOPTS="-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar=web"
ENV SONAR_CE_JAVAADDITIONALOPTS="-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar=ce"

0 comments on commit fde1c77

Please sign in to comment.