FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=e3d24d9b1b9719423109805e93a82285db761827 SOURCE_DATE_EPOCH=1572023549 BUILD_VERSION=v4.2.4 SOURCE_GIT_URL=https://github.com/openshift/image-registry SOURCE_GIT_TAG=atomic-openshift-dockerregistry-4.0.0-0.146.0-56-ge3d24d9b BUILD_RELEASE=201911050122
WORKDIR /go/src/github.com/openshift/image-registry
COPY . .
RUN hack/build-go.sh

FROM openshift/ose-base:v4.2.4.20191105.012255
ENV SOURCE_GIT_COMMIT=e3d24d9b1b9719423109805e93a82285db761827 SOURCE_DATE_EPOCH=1572023549 BUILD_VERSION=v4.2.4 SOURCE_GIT_URL=https://github.com/openshift/image-registry SOURCE_GIT_TAG=atomic-openshift-dockerregistry-4.0.0-0.146.0-56-ge3d24d9b BUILD_RELEASE=201911050122
RUN yum install -y rsync
COPY --from=builder /go/src/github.com/openshift/image-registry/_output/local/bin/dockerregistry /usr/bin/
COPY images/dockerregistry/config.yml /
RUN chmod a+w -R /etc/pki/ca-trust/extracted
USER 1001
EXPOSE 5000
VOLUME /registry
ENV REGISTRY_CONFIGURATION_PATH=/config.yml
ENTRYPOINT ["sh", "-c", "update-ca-trust && exec \"$@\"", "arg0"]
CMD ["/usr/bin/dockerregistry"]

LABEL \
        io.k8s.description="This is a component of OpenShift Container Platform and exposes a container registry that is integrated with the cluster for authentication and management." \
        com.redhat.component="openshift-enterprise-registry-container" \
        vendor="Red Hat" \
        name="openshift/ose-docker-registry" \
        License="GPLv2+" \
        io.k8s.display-name="OpenShift Container Platform Image Registry" \
        io.openshift.build.source-location="https://github.com/openshift/image-registry" \
        io.openshift.build.commit.url="https://github.com/openshift/image-registry/commit/e3d24d9b1b9719423109805e93a82285db761827" \
        version="v4.2.4" \
        io.openshift.build.commit.id="e3d24d9b1b9719423109805e93a82285db761827" \
        release="201911050122" \
        io.openshift.tags="openshift,container,image,registry"

