Skip to content

Commit 90815f2

Browse files
committed
Pass version to container image correctly
1 parent f6d3e51 commit 90815f2

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Stage - builder
22
FROM golang as builder
33

4-
ARG VER
54

65
ENV GOOS=linux
76
ENV GOARCH=amd64
87
ENV CGO_ENABLED=0
9-
ENV VERSION=0.0.0
108

119
WORKDIR /build
1210

@@ -15,6 +13,9 @@ COPY go.sum ./
1513
COPY main.go ./
1614
RUN go mod download
1715

16+
ARG VER=0.0.0
17+
ENV VERSION=${VER}
18+
1819
ADD . src
1920

2021
WORKDIR /build/src
@@ -24,15 +25,18 @@ RUN make build
2425
# Stage - runner
2526
FROM alpine/helm
2627

27-
RUN curl -o /bin/kubectl -vf -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x /bin/kubectl && kubectl --help
28+
# Python
29+
RUN apk add --update --no-cache python3 && python3 -m ensurepip && pip3 install --upgrade pip setuptools
2830

29-
# Checkov scanner
30-
RUN apk add --update --no-cache python3
31-
RUN python3 -m ensurepip
32-
RUN pip3 install checkov
31+
# kubectl
32+
RUN curl -o /bin/kubectl -vf -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x /bin/kubectl && kubectl --help
3333

3434
# Trivy
3535
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.18.3
36+
RUN trivy --version
37+
38+
# Checkov scanner
39+
RUN pip3 install checkov packaging==21.3 && checkov --version
3640

3741
COPY --from=builder /build/src/bin/dashboard /bin/helm-dashboard
3842

0 commit comments

Comments
 (0)