From 76761e52bf3f27f7f8ce9b4fe45974f28874dd7d Mon Sep 17 00:00:00 2001 From: Brett Anspach Date: Sun, 15 May 2022 21:03:14 -0500 Subject: [PATCH] INF-2341 Add step to install PowerShell --- Dockerfile | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0287434..93c311f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,42 @@ FROM sonarsource/sonar-scanner-cli:4.7 LABEL version="1.1.0" \ - repository="https://github.com/sonarsource/sonarqube-scan-action" \ - homepage="https://github.com/sonarsource/sonarqube-scan-action" \ - maintainer="SonarSource" \ - com.github.actions.name="SonarQube Scan" \ - com.github.actions.description="Scan your code with SonarQube to detect Bugs, Vulnerabilities and Code Smells in up to 27 programming languages!" \ - com.github.actions.icon="check" \ - com.github.actions.color="green" + repository="https://github.com/sonarsource/sonarqube-scan-action" \ + homepage="https://github.com/sonarsource/sonarqube-scan-action" \ + maintainer="SonarSource" \ + com.github.actions.name="SonarQube Scan" \ + com.github.actions.description="Scan your code with SonarQube to detect Bugs, Vulnerabilities and Code Smells in up to 27 programming languages!" \ + com.github.actions.icon="check" \ + com.github.actions.color="green" # Add certificate in java keystore COPY wildcard_corp_ingenio_com.pem . RUN keytool -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias sonarqube -file wildcard_corp_ingenio_com.pem +# Install PowerShell +# https://docs.microsoft.com/en-us/powershell/scripting/install/install-alpine?view=powershell-7.2#installation-steps +RUN sudo apk add --no-cache \ + ca-certificates \ + less \ + ncurses-terminfo-base \ + krb5-libs \ + libgcc \ + libintl \ + libssl1.1 \ + libstdc++ \ + tzdata \ + userspace-rcu \ + zlib \ + icu-libs \ + curl; \ +RUN sudo apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \ + lttng-ust +RUN wget -O powershell.tar.gz -fSL https://github.com/PowerShell/PowerShell/releases/download/v7.2.3/powershell-7.2.3-linux-alpine-x64.tar.gz; \ + sudo mkdir -p /opt/microsoft/powershell/7; \ + sudo tar zxf ./powershell.tar.gz -C /opt/microsoft/powershell/7; \ + sudo chmod +x /opt/microsoft/powershell/7/pwsh; \ + sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh + COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]