-
Notifications
You must be signed in to change notification settings - Fork 96
/
Dockerfile.scorecard
44 lines (32 loc) · 1.37 KB
/
Dockerfile.scorecard
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
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS builder
WORKDIR /workspace
# Copy the Go Modules manifests and vendor
COPY go.mod ./go.mod
COPY go.sum ./go.sum
COPY vendor ./vendor
COPY test ./test
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY make ./make
COPY Makefile ./Makefile
# Copy the go source
COPY test/scorecard ./test/scorecard
# Build
RUN GOOS=linux GOARCH=amd64 make scorecard/compile
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
# kubectl 1.18
RUN curl -Lso /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl
# kuttl v0.11.1
RUN curl -Lso /usr/local/bin/kubectl-kuttl https://github.com/kudobuilder/kuttl/releases/download/v0.11.1/kubectl-kuttl_0.11.1_linux_x86_64
RUN chmod +x /usr/local/bin/*
ENV HOME=/opt/scorecard-test-kuttl \
USER_NAME=scorecard-test-kuttl \
USER_UID=1001 \
KUBECONFIG=
RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd
WORKDIR ${HOME}
COPY --from=builder /workspace/scorecard-test-kuttl /usr/local/bin/scorecard-test-kuttl
COPY --from=builder /workspace/test/scorecard/entrypoint /usr/local/bin/entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint"]
USER ${USER_UID}