1
0
mirror of https://github.com/mc1arke/sonarqube-community-branch-plugin.git synced 2025-02-21 19:20:09 +02:00

#958: Remove group assignment during container build

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.
This commit is contained in:
Michael Clarke 2024-09-07 09:45:36 +01:00 committed by Michael Clarke
parent 0648ca45c7
commit fde1c7770c
2 changed files with 3 additions and 3 deletions

View File

@ -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}

View File

@ -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"