# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
#   Red Hat, Inc. - initial API and implementation
#

# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
FROM ubi8-minimal:8.2-301.1592810506 as builder
RUN microdnf install -y findutils

# not applicable to Che, only needed for CRW
ADD controller-manifests /manifests
ADD build /build
RUN /build/scripts/swap_images.sh /manifests

FROM scratch
COPY --from=builder /manifests /manifests

# append Brew metadata here (it will be appended via https://github.com/redhat-developer/codeready-workspaces-operator/blob/master/operator-metadata.Jenkinsfile)
ENV SUMMARY="Red Hat CodeReady Workspaces operator-metadata container" \
    DESCRIPTION="Red Hat CodeReady Workspaces operator-metadata container" \
    PRODNAME="codeready-workspaces" \
    COMPNAME="operator-metadata" 
LABEL summary="$SUMMARY" \
      description="$DESCRIPTION" \
      io.k8s.description="$DESCRIPTION" \
      io.k8s.display-name="$DESCRIPTION" \
      io.openshift.tags="$PRODNAME,$COMPNAME" \
      com.redhat.component="$PRODNAME-rhel8-$COMPNAME-container" \
      name="$PRODNAME/$COMPNAME" \
      version="2.2" \
      license="EPLv2" \
      maintainer="Nick Boldt <nboldt@redhat.com>" \
      io.openshift.expose-services="" \
      com.redhat.delivery.appregistry="true" \
      usage="" 
