forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.assisted-service-build
56 lines (48 loc) · 2.35 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
FROM registry.ci.openshift.org/openshift/release:golang-1.18 AS golang
RUN chmod g+xw -R /usr/local/go
FROM quay.io/centos/centos:stream8
ENV GOPATH=/go
ENV GOROOT=/usr/local/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=quay.io/app-sre/golangci-lint:v1.46.0 /usr/bin/golangci-lint /usr/bin/golangci-lint
# 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=golang /usr/bin/gotestsum /usr/bin/make /usr/bin/
COPY --from=golang /usr/local/go /usr/local/go
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 'dnf-command(config-manager)' && \
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
dnf install -y --enablerepo=powertools \
openssl postgresql nmstate-devel sqlite gcc genisoimage git docker-ce-cli libvirt-client libvirt-devel java && \
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