mirror of
https://github.com/sonarsource/sonarcloud-github-action.git
synced 2026-06-08 10:47:13 +00:00
Speed-up initialization of action
by using the built image of scanner CLI
This commit is contained in:
parent
6b0def60a4
commit
c35654669e
1 changed files with 3 additions and 20 deletions
23
Dockerfile
23
Dockerfile
|
|
@ -1,4 +1,4 @@
|
||||||
FROM openjdk:11-jre-slim
|
FROM sonarsource/sonar-scanner-cli:4.3
|
||||||
|
|
||||||
LABEL version="0.0.1"
|
LABEL version="0.0.1"
|
||||||
LABEL repository="https://github.com/sonarsource/sonarcloud-github-action"
|
LABEL repository="https://github.com/sonarsource/sonarcloud-github-action"
|
||||||
|
|
@ -12,29 +12,12 @@ LABEL "com.github.actions.color"="green"
|
||||||
ARG SONAR_SCANNER_HOME=/opt/sonar-scanner
|
ARG SONAR_SCANNER_HOME=/opt/sonar-scanner
|
||||||
ARG NODEJS_HOME=/opt/nodejs
|
ARG NODEJS_HOME=/opt/nodejs
|
||||||
|
|
||||||
ENV SONAR_SCANNER_HOME=${SONAR_SCANNER_HOME} \
|
|
||||||
SONAR_SCANNER_VERSION=3.3.0.1492 \
|
|
||||||
NODEJS_HOME=${NODEJS_HOME} \
|
|
||||||
NODEJS_VERSION=v8.12.0
|
|
||||||
|
|
||||||
ENV PATH=${PATH}:${SONAR_SCANNER_HOME}/bin:${NODEJS_HOME}/bin
|
ENV PATH=${PATH}:${SONAR_SCANNER_HOME}/bin:${NODEJS_HOME}/bin
|
||||||
|
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
|
|
||||||
RUN apt-get update \
|
# https://help.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
|
||||||
&& apt-get install -y --no-install-recommends wget git jq unzip tar xz-utils \
|
USER root
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN wget -U "sonarcloud-github-action" -q -O sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip \
|
|
||||||
&& unzip sonar-scanner-cli.zip \
|
|
||||||
&& rm sonar-scanner-cli.zip \
|
|
||||||
&& mv sonar-scanner-${SONAR_SCANNER_VERSION} ${SONAR_SCANNER_HOME}
|
|
||||||
|
|
||||||
RUN wget -q -O nodejs.tar.xz https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz \
|
|
||||||
&& tar -Jxf nodejs.tar.xz \
|
|
||||||
&& mv node-${NODEJS_VERSION}-linux-x64 ${NODEJS_HOME}
|
|
||||||
|
|
||||||
RUN npm install -g typescript
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue