diff --git a/10/datacenter/app/Dockerfile b/10/datacenter/app/Dockerfile index 6b6108d9..27dcc8f0 100644 --- a/10/datacenter/app/Dockerfile +++ b/10/datacenter/app/Dockerfile @@ -57,7 +57,12 @@ RUN set -eux; \ mv "sonarqube-${SONARQUBE_VERSION}" sonarqube; \ rm sonarqube.zip*; \ rm -rf ${SONARQUBE_HOME}/bin/*; \ - ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; \ + ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; + +COPY run.sh sonar.sh ${SONARQUBE_HOME}/docker/ + +RUN chown -R sonarqube:root ${SONARQUBE_HOME}; \ + chown -R sonarqube:root "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ chmod -R 550 ${SONARQUBE_HOME}; \ chmod -R 770 "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ apt-get remove -y gnupg unzip; \ @@ -65,8 +70,6 @@ RUN set -eux; \ VOLUME ["${SQ_DATA_DIR}", "${SQ_EXTENSIONS_DIR}", "${SQ_LOGS_DIR}", "${SQ_TEMP_DIR}"] -COPY run.sh sonar.sh ${SONARQUBE_HOME}/docker/ - WORKDIR ${SONARQUBE_HOME} EXPOSE 9000 diff --git a/10/datacenter/search/Dockerfile b/10/datacenter/search/Dockerfile index 4b0b8275..a3d14eab 100644 --- a/10/datacenter/search/Dockerfile +++ b/10/datacenter/search/Dockerfile @@ -60,7 +60,12 @@ RUN set -eux; \ mv "sonarqube-${SONARQUBE_VERSION}" sonarqube; \ rm sonarqube.zip*; \ rm -rf ${SONARQUBE_HOME}/bin/*; \ - ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; \ + ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; + +COPY run.sh sonar.sh ${SONARQUBE_HOME}/docker/ + +RUN chown -R sonarqube:root ${SONARQUBE_HOME}; \ + chown -R sonarqube:root "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ chmod -R 550 ${SONARQUBE_HOME}; \ chmod -R 770 "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ apt-get remove -y gnupg unzip curl; \ @@ -68,8 +73,6 @@ RUN set -eux; \ VOLUME ["${SQ_DATA_DIR}", "${SQ_EXTENSIONS_DIR}", "${SQ_LOGS_DIR}", "${SQ_TEMP_DIR}"] -COPY run.sh sonar.sh ${SONARQUBE_HOME}/docker/ - WORKDIR ${SONARQUBE_HOME} EXPOSE 9000 diff --git a/10/developer/Dockerfile b/10/developer/Dockerfile index 010990a0..00e5e271 100644 --- a/10/developer/Dockerfile +++ b/10/developer/Dockerfile @@ -57,7 +57,12 @@ RUN set -eux; \ mv "sonarqube-${SONARQUBE_VERSION}" sonarqube; \ rm sonarqube.zip*; \ rm -rf ${SONARQUBE_HOME}/bin/*; \ - ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; \ + ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; + +COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ + +RUN chown -R sonarqube:root ${SONARQUBE_HOME}; \ + chown -R sonarqube:root "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ chmod -R 550 ${SONARQUBE_HOME}; \ chmod -R 770 "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ apt-get remove -y gnupg unzip; \ @@ -65,8 +70,6 @@ RUN set -eux; \ VOLUME ["${SQ_DATA_DIR}", "${SQ_EXTENSIONS_DIR}", "${SQ_LOGS_DIR}", "${SQ_TEMP_DIR}"] -COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ - WORKDIR ${SONARQUBE_HOME} EXPOSE 9000 diff --git a/10/enterprise/Dockerfile b/10/enterprise/Dockerfile index c1f559f2..f626f021 100644 --- a/10/enterprise/Dockerfile +++ b/10/enterprise/Dockerfile @@ -57,7 +57,12 @@ RUN set -eux; \ mv "sonarqube-${SONARQUBE_VERSION}" sonarqube; \ rm sonarqube.zip*; \ rm -rf ${SONARQUBE_HOME}/bin/*; \ - ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; \ + ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; + +COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ + +RUN chown -R sonarqube:root ${SONARQUBE_HOME}; \ + chown -R sonarqube:root "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ chmod -R 550 ${SONARQUBE_HOME}; \ chmod -R 770 "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ apt-get remove -y gnupg unzip; \ @@ -65,8 +70,6 @@ RUN set -eux; \ VOLUME ["${SQ_DATA_DIR}", "${SQ_EXTENSIONS_DIR}", "${SQ_LOGS_DIR}", "${SQ_TEMP_DIR}"] -COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ - WORKDIR ${SONARQUBE_HOME} EXPOSE 9000 diff --git a/community-build/Dockerfile b/community-build/Dockerfile index 8d978726..f2e22518 100644 --- a/community-build/Dockerfile +++ b/community-build/Dockerfile @@ -57,7 +57,12 @@ RUN set -eux; \ mv "sonarqube-${SONARQUBE_VERSION}" sonarqube; \ rm sonarqube.zip*; \ rm -rf ${SONARQUBE_HOME}/bin/*; \ - ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; \ + ln -s "${SONARQUBE_HOME}/lib/sonar-application-${SONARQUBE_VERSION}.jar" "${SONARQUBE_HOME}/lib/sonarqube.jar"; + +COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ + +RUN chown -R sonarqube:root ${SONARQUBE_HOME}; \ + chown -R sonarqube:root "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ chmod -R 550 ${SONARQUBE_HOME}; \ chmod -R 770 "${SQ_DATA_DIR}" "${SQ_EXTENSIONS_DIR}" "${SQ_LOGS_DIR}" "${SQ_TEMP_DIR}"; \ apt-get remove -y gnupg unzip; \ @@ -65,8 +70,6 @@ RUN set -eux; \ VOLUME ["${SQ_DATA_DIR}", "${SQ_EXTENSIONS_DIR}", "${SQ_LOGS_DIR}", "${SQ_TEMP_DIR}"] -COPY entrypoint.sh ${SONARQUBE_HOME}/docker/ - WORKDIR ${SONARQUBE_HOME} EXPOSE 9000