FROM rhel8-go-toolset:1.14 AS builder
WORKDIR /opt/app-root/src/go/src/knative.dev/eventing
COPY . .
ENV GOFLAGS="-mod=vendor"
RUN go build -o /tmp/migrate ./vendor/knative.dev/pkg/apiextensions/storageversion/cmd/migrate

FROM registry.redhat.io/ubi8/ubi-minimal
COPY --from=builder /tmp/migrate /ko-app/migrate

LABEL \
      com.redhat.component="openshift-serverless-1-eventing-storage-version-migration-rhel8-container" \
      name="openshift-serverless-1/eventing-storage-version-migration-rhel8" \
      version="0.18.6" \
      summary="Red Hat OpenShift Serverless 1 Eventing Storage Version Migration" \
      maintainer="serverless-support@redhat.com" \
      description="Red Hat OpenShift Serverless 1 Eventing Storage Version Migration" \
      io.k8s.display-name="Red Hat OpenShift Serverless 1 Eventing Storage Version Migration"

ENTRYPOINT ["/ko-app/migrate"]
