-
Notifications
You must be signed in to change notification settings - Fork 216
/
Dockerfile.assisted-service-build
57 lines (47 loc) · 2.27 KB
/
Dockerfile.assisted-service-build
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
49
50
51
52
53
54
55
56
57
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS golang
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.0
RUN go install gotest.tools/gotestsum@latest
FROM quay.io/centos/centos:stream9
ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV VIRTUAL_ENV=/opt/venv
# A directory in the path with write permission even for non-root users
ENV TOOLS=/tools/
ENV PATH="$VIRTUAL_ENV/bin:$GOROOT/bin:$GOPATH/bin:$TOOLS:$PATH"
COPY --from=golang $GOPATH $GOPATH
COPY --from=golang $GOROOT $GOROOT
RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT
# TODO: Replace with version 0.30.4 once it is released.
#
# We need version 5d0a00d of go-swagger because it is the first that contains
# the change that we need in order to be able to reject unknown JSON fields.
# That will eventually be part of release 0.30.4, but that doesn't exist yet.
#
# For details see the pull request where that capability was added:
#
# https://github.com/go-swagger/go-swagger/pull/2863
#
# And the ticket:
#
# https://issues.redhat.com/browse/MGMT-12697
COPY --from=quay.io/goswagger/swagger:sha-5d0a00d /usr/bin/swagger /usr/bin/goswagger
COPY --from=quay.io/edge-infrastructure/swagger-codegen-cli:2.4.18 /opt/swagger-codegen-cli /opt/swagger-codegen-cli
COPY --from=quay.io/openshift/origin-cli:latest /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/upstream-opm-builder:v1.16.1 /bin/opm /bin
COPY --from=registry.k8s.io/kustomize/kustomize:v4.3.0 /app/kustomize /usr/bin/
COPY --from=quay.io/coreos/shellcheck-alpine:v0.5.0 /bin/shellcheck /usr/bin/shellcheck
RUN dnf install -y --enablerepo=crb \
openssl openssl-devel postgresql nmstate-devel sqlite gcc genisoimage git libvirt-client libvirt-devel java make && \
dnf clean all
# Git checks if the user that owns the files on the filesystem match the
# current user. We need to disable this check because tests in Prow are
# running with a random user.
RUN git config --system --add safe.directory '*'
WORKDIR /home/assisted-service
RUN mkdir build $TOOLS --mode g+xw
COPY ./hack/setup_env.sh ./dev-requirements.txt ./
RUN ./setup_env.sh podman_remote && \
./setup_env.sh assisted_service && \
dnf clean all && \
chmod g+xw -R $GOPATH
COPY ./data /tmp/data