-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile_Deprecated
executable file
·35 lines (26 loc) · 1.11 KB
/
Dockerfile_Deprecated
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM golang:1.20-alpine as build
RUN apk add --no-cache --update git
RUN mkdir -p /go/src/github.com/diegopereiraeng/harness-cie-sonarqube-scanner
WORKDIR /go/src/github.com/diegopereiraeng/harness-cie-sonarqube-scanner
COPY *.go ./
COPY *.mod ./
RUN go env GOCACHE
RUN go get github.com/sirupsen/logrus
RUN go get github.com/pelletier/go-toml/cmd/tomll
RUN go get github.com/urfave/cli
RUN go get github.com/joho/godotenv
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o harness-sonar
FROM openjdk:11.0.16-jre
ARG SONAR_VERSION=4.6.2.2472
ARG SONAR_SCANNER_CLI=sonar-scanner-cli-${SONAR_VERSION}
ARG SONAR_SCANNER=sonar-scanner-${SONAR_VERSION}
RUN apt-get update \
&& apt-get install -y nodejs curl \
&& apt-get clean
COPY --from=build /go/src/github.com/diegopereiraeng/harness-cie-sonarqube-scanner/harness-sonar /bin/
WORKDIR /bin
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${SONAR_SCANNER_CLI}.zip -so /bin/${SONAR_SCANNER_CLI}.zip
RUN unzip ${SONAR_SCANNER_CLI}.zip \
&& rm ${SONAR_SCANNER_CLI}.zip
ENV PATH $PATH:/bin/${SONAR_SCANNER}/bin
ENTRYPOINT /bin/harness-sonar