-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathDockerfile.e2etest
48 lines (35 loc) · 1.32 KB
/
Dockerfile.e2etest
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
48
# Copyright (c) 2020 Red Hat, Inc.
# Stage 1: Use image builder to retrieve Go binaries
FROM registry.ci.openshift.org/stolostron/builder:go1.22-linux AS builder
# Stage 2: Copy Go binaries and run tests on ubi-minimal
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
RUN microdnf update -y \
&& microdnf install -y tar \
&& microdnf install -y gzip \
&& microdnf install -y git \
&& microdnf install -y which \
&& microdnf install -y make \
&& microdnf install -y findutils \
&& microdnf clean all
# prepare jq
ADD https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 /usr/local/bin/jq
RUN chmod +x /usr/local/bin/jq
# copy go files from builder image
COPY --from=builder /usr/local/go /usr/local/go
COPY --from=builder /go /go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
WORKDIR $GOPATH
RUN mkdir -p $GOPATH/src/github.com/stolostron/governance-policy-framework
WORKDIR $GOPATH/src/github.com/stolostron/governance-policy-framework
COPY go.mod .
COPY go.sum .
COPY Makefile .
COPY test ./test
COPY build ./build
RUN ./build/download-clis.sh
RUN make e2e-dependencies
RUN go mod vendor
# Give write permissions for the directory
RUN chmod -R go+w $GOPATH/src/github.com/stolostron/governance-policy-framework
CMD ["./build/run-test-image.sh"]