# Build the manager binary
FROM openshift/golang-builder:1.14 AS builder
ADD . .
RUN mkdir -p /go/src/github.com/konveyor/mig-controller
RUN tar --strip-components=1 -xvf release-1.2.5.tar.gz -C /go/src/github.com/konveyor/mig-controller
WORKDIR /go/src/github.com/konveyor/mig-controller

# Build
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/konveyor/mig-controller/cmd/manager

# Copy the controller-manager into a thin image
FROM ubi8-minimal:8-released
WORKDIR /
COPY --from=builder /go/src/github.com/konveyor/mig-controller/manager .
ENTRYPOINT ["/manager"]

LABEL \
        com.redhat.component="openshift-migration-controller-container" \
        version="v1.2" \
        name="rhcam/openshift-migration-controller" \
        License="ASL 2.0" \
        release="15" \
        io.k8s.display-name="Cluster Application Migration" \
        io.openshift.tags="migration" \
        io.k8s.description="Cluster Application Migration Controller" \
        summary="Cluster Application Migration Controller" \
        maintainer="Migration Team <ocp-migrate-team@redhat.com>"
