-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
47 lines (34 loc) · 1.64 KB
/
Dockerfile
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
36
37
38
39
40
41
42
43
44
45
46
47
ARG GOLANGCI_LINT_VERSION=v1.59.1
ARG GOSEC_VERSION=v2.20.0
ARG SEMGREP_VERSION=1.84.1
FROM golang:1.22-alpine3.19 AS builder
ARG GOLANGCI_LINT_VERSION
ARG GOSEC_VERSION
ARG SEMGREP_VERSION
WORKDIR /go/src/github.com/grafana/plugin-validator
ADD . /go/src/github.com/grafana/plugin-validator
RUN apk add --no-cache git ca-certificates curl python3 python3-dev py3-pip clamav
RUN update-ca-certificates
RUN freshclam
RUN git clone https://github.com/magefile/mage --depth 1 && \
cd mage && \
go run bootstrap.go && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} && \
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b /usr/local/bin ${GOSEC_VERSION} && \
python3 -m pip install semgrep==${SEMGREP_VERSION} --ignore-installed --break-system-packages
RUN cd /go/src/github.com/grafana/plugin-validator && \
mage -v build:ci && \
ls -al bin
FROM alpine:3.19
ARG GOSEC_VERSION
ARG SEMGREP_VERSION
RUN apk add --no-cache git ca-certificates curl wget python3 python3-dev py3-pip alpine-sdk clamav
RUN update-ca-certificates
RUN freshclam
RUN curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b /usr/local/bin ${GOSEC_VERSION}
# install semgrep
RUN python3 -m pip install semgrep==${SEMGREP_VERSION} --ignore-installed --break-system-packages --no-cache-dir
WORKDIR /app
COPY --from=builder /go/src/github.com/grafana/plugin-validator/bin bin
COPY --from=builder /go/src/github.com/grafana/plugin-validator/config config
ENTRYPOINT ["/app/bin/linux_amd64/plugincheck2"]