forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.assisted-service.ocp
More file actions
43 lines (32 loc) · 1.81 KB
/
Dockerfile.assisted-service.ocp
File metadata and controls
43 lines (32 loc) · 1.81 KB
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
# URGENT! ART metadata configuration has a different number of FROMs
# than this Dockerfile. ART will be unable to build your component or
# reconcile this Dockerfile until that disparity is addressed.
# Build binaries
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.12 AS builder
WORKDIR /src
COPY . .
RUN CGO_ENABLED=1 GOFLAGS="" GO111MODULE=on go build -o /build/assisted-service cmd/main.go
RUN CGO_ENABLED=0 GOFLAGS="" GO111MODULE=on go build -o /build/assisted-service-operator cmd/operator/main.go
RUN CGO_ENABLED=0 GOFLAGS="" GO111MODULE=on go build -o /build/assisted-service-admission cmd/webadmission/main.go
RUN CGO_ENABLED=0 GOFLAGS="" GO111MODULE=on go build -o /build/agent-installer-client cmd/agentbasedinstaller/client/main.go
FROM registry.ci.openshift.org/ocp/4.12:cli AS oc-image
# Create final image
FROM registry.ci.openshift.org/ocp/4.12:base
LABEL io.openshift.release.operator=true
# ToDo: Replace postgres with SQLite DB
# https://issues.redhat.com/browse/AGENT-223
RUN dnf install -y postgresql-server libvirt-libs nmstate && dnf clean all
COPY hack/agent_installer/start_db.sh start_db.sh
RUN su - postgres -c "mkdir -p /tmp/postgres/data"
RUN su - postgres -c "/usr/bin/initdb -D /tmp/postgres/data"
ARG WORK_DIR=/data
RUN mkdir $WORK_DIR && chmod 775 $WORK_DIR
COPY --from=oc-image /usr/bin/oc /usr/local/bin/
COPY --from=builder /build/assisted-service /assisted-service
COPY --from=builder /build/assisted-service-operator /assisted-service-operator
COPY --from=builder /build/assisted-service-admission /assisted-service-admission
COPY --from=builder /build/agent-installer-client /usr/local/bin/agent-installer-client
RUN ln -s /usr/local/bin/agent-installer-client /agent-based-installer-register-cluster-and-infraenv
ENV GODEBUG=madvdontneed=1
ENV GOGC=50
CMD ["/assisted-service"]