distribution/Dockerfile

45 lines
1.7 KiB
Docker
Raw Normal View History

# syntax=docker/dockerfile:1.3
2022-09-12 09:47:48 +02:00
#!BuildTag: suse/alp/workloads/distribution:3.0
#!BuildTag: suse/alp/workloads/distribution:3.0-%RELEASE%
#!BuildTag: suse/alp/workloads/distribution:latest
2022-09-13 15:02:36 +02:00
LABEL maintainer="Marco Varlese <mvarlese@suse.com>"
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.alp.workloads.distribution
LABEL org.opencontainers.image.title="Distribution registry Container Image"
LABEL org.opencontainers.image.description="Distribution registry container based on BCI"
LABEL org.opencontainers.image.version="3.0"
LABEL org.opencontainers.image.url="https://gitea.opensuse.org/fcrozat/distributionr/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opensuse.reference="registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/distribution-3.0-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.eula="beta"
LABEL com.suse.image-type="application"
2022-09-14 15:38:28 +02:00
LABEL com.suse.release-stage="prototype"
2022-09-13 15:02:36 +02:00
# endlabelprefix
ARG BCI_MICRO=registry.suse.com/bci/bci-micro
ARG BCI_GO=registry.suse.com/bci/golang
ARG GO_VERSION=1.18
2022-09-28 15:51:40 +02:00
FROM $BCI_GO:$GO_VERSION AS base
WORKDIR /src
FROM base AS build
ENV GO111MODULE=auto
2023-06-08 14:22:03 +02:00
# no need for full static build on BCI
2022-09-12 14:45:23 +02:00
ENV CGO_ENABLED=1
2023-06-08 14:22:03 +02:00
RUN --mount=type=bind,target=/src,rw \
2022-09-14 09:46:04 +02:00
--mount=type=cache,target=/root/.cache/go-build \
2023-06-08 14:22:03 +02:00
--mount=target=/go/pkg/mod,type=cache \
2022-09-14 09:46:04 +02:00
go build -o /go/bin/registry ./cmd/registry
2023-06-08 14:22:03 +02:00
FROM $BCI_MICRO
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
2022-09-12 14:45:23 +02:00
COPY --from=build /go/bin/registry /bin/registry
VOLUME ["/var/lib/registry"]
EXPOSE 5000
ENTRYPOINT ["registry"]
CMD ["serve", "/etc/docker/registry/config.yml"]