1
0
mirror of https://github.com/openshift/image-registry.git synced 2026-02-05 09:45:55 +01:00
Files
image-registry/Dockerfile.ocp

31 lines
1.6 KiB
Docker

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.22 AS builder
WORKDIR /go/src/github.com/openshift/image-registry
COPY . .
RUN hack/build-go.sh
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
RUN yum install -y rsync && yum clean all && rm -rf /var/cache/yum
# Copy both registry binaries:
# - dockerregistry: OpenShift-integrated registry with authentication, quotas, and mirroring
# - distribution: Generic distribution/distribution registry for standalone use
COPY --from=builder /go/src/github.com/openshift/image-registry/_output/local/bin/dockerregistry /usr/bin/
COPY --from=builder /go/src/github.com/openshift/image-registry/_output/local/bin/distribution /usr/bin/
# Copy configuration files:
# - /config.yml: OpenShift-specific config for dockerregistry binary (default via REGISTRY_CONFIGURATION_PATH)
# - /etc/registry/config.yaml: Generic config for distribution binary (standard distribution location)
COPY images/dockerregistry/config.yml /
RUN mkdir -p /etc/registry
COPY images/registry/config.yaml /etc/registry/config.yaml
ADD images/dockerregistry/writable-extracted.tar.gz /etc/pki/ca-trust/extracted
USER 1001
EXPOSE 5000
VOLUME /registry
ENV REGISTRY_CONFIGURATION_PATH=/config.yml
ENTRYPOINT ["sh", "-c", "update-ca-trust extract && exec \"$@\"", "arg0"]
CMD ["/usr/bin/dockerregistry"]
LABEL io.k8s.display-name="OpenShift Image Registry" \
io.k8s.description="This is a component of OpenShift and exposes a container image registry that is integrated with the cluster for authentication and management." \
io.openshift.tags="openshift,docker,registry"