-
Notifications
You must be signed in to change notification settings - Fork 15
/
kubefed-operator-ci.Dockerfile
43 lines (29 loc) · 1.36 KB
/
kubefed-operator-ci.Dockerfile
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
# This Dockerfile represents a multistage build. The stages, respectively:
#
# 1. build federation binaries
# 2. copy binaries in, add OLM manifests, labels, etc
# build stage 1: build federation binaries
FROM openshift/origin-release:golang-1.12 as builder
ENV GOPATH /go
COPY . /go/src/github.com/openshift/kubefed-operator/
ENV BIN_DIR="build/_output/bin" \
PROJECT_NAME=kubefed-operator \
BUILD_PATH="./cmd/manager"
WORKDIR /go/src/github.com/openshift/kubefed-operator
RUN mkdir -p ${BIN_DIR} \
&& echo "Building "${PROJECT_NAME}"..." \
&& CGO_ENABLED=0 GO111MODULE=off go build -o ${BIN_DIR}/${PROJECT_NAME} -i ${BUILD_PATH}
FROM registry.access.redhat.com/ubi7-dev-preview/ubi-minimal:7.6
ENV OPERATOR=/usr/local/bin/kubefed-operator \
USER_UID=1001 \
USER_NAME=kubefed-operator
LABEL com.redhat.delivery.appregistry=true
COPY --from=builder /go/src/github.com/openshift/kubefed-operator/deploy/olm-catalog/kubefed-operator /manifests
# install operator binary
COPY --from=builder /go/src/github.com/openshift/kubefed-operator/build/_output/bin/kubefed-operator ${OPERATOR}
COPY --from=builder /go/src/github.com/openshift/kubefed-operator/deploy /deploy
COPY --from=builder /go/src/github.com/openshift/kubefed-operator/build/bin /usr/local/bin
RUN /usr/local/bin/user_setup
WORKDIR /
ENTRYPOINT ["/usr/local/bin/entrypoint"]
USER ${USER_UID}