distribution/Dockerfile

29 lines
891 B
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
ARG BCI_MICRO=registry.suse.com/bci/bci-micro
ARG BCI_GO=registry.suse.com/bci/golang
ARG GO_VERSION=1.18
2022-09-05 17:04:56 +02:00
#FROM $BCI_GO:$GO_VERSION AS base
FROM registry.suse.com/bci/golang:1.18 AS base
WORKDIR /src
FROM base AS build
ENV GO111MODULE=auto
2022-09-12 14:45:23 +02:00
ENV CGO_ENABLED=1
RUN --mount=type=bind,target=/src \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
2022-09-12 14:45:23 +02:00
go build -o /go/bin/registry ./cmd/registry
2022-09-12 14:45:23 +02:00
FROM registry.suse.com/bci/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"]