Compare commits
No commits in common. "e275b73720d9a6442a4ee2a0bc6fa8842e0b8f42" and "20dac54258b5726b50c29a91a3896557fe266959" have entirely different histories.
e275b73720
...
20dac54258
59
Dockerfile
59
Dockerfile
@ -3,41 +3,52 @@
|
|||||||
#!BuildTag: suse/alp/workloads/distribution:3.0-%RELEASE%
|
#!BuildTag: suse/alp/workloads/distribution:3.0-%RELEASE%
|
||||||
#!BuildTag: suse/alp/workloads/distribution:latest
|
#!BuildTag: suse/alp/workloads/distribution:latest
|
||||||
|
|
||||||
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"
|
|
||||||
LABEL com.suse.release-stage="prototype"
|
|
||||||
# endlabelprefix
|
|
||||||
|
|
||||||
ARG BCI_MICRO=registry.suse.com/bci/bci-micro
|
ARG BCI_MICRO=registry.suse.com/bci/bci-micro
|
||||||
ARG BCI_GO=registry.suse.com/bci/golang
|
ARG BCI_GO=registry.suse.com/bci/golang
|
||||||
ARG GO_VERSION=1.18
|
ARG GO_VERSION=1.18
|
||||||
|
ARG GORELEASER_XX_VERSION=1.2.5
|
||||||
|
|
||||||
FROM $BCI_GO:$GO_VERSION AS base
|
FROM crazymax/goreleaser-xx:${GORELEASER_XX_VERSION} AS goreleaser-xx
|
||||||
|
#FROM $BCI_GO:$GO_VERSION AS base
|
||||||
|
FROM registry.suse.com/bci/golang:1.18 AS base
|
||||||
|
COPY --from=goreleaser-xx / /
|
||||||
|
#RUN zypper --non-interactive install -y file git-core
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
ENV GO111MODULE=auto
|
ENV GO111MODULE=auto
|
||||||
# no need for full static build on BCI
|
ENV CGO_ENABLED=0
|
||||||
ENV CGO_ENABLED=1
|
# GIT_REF is used by goreleaser-xx to handle the proper git ref when available.
|
||||||
|
# It will fallback to the working tree info if empty and use "git tag --points-at"
|
||||||
|
# or "git describe" to define the version info.
|
||||||
|
ARG GIT_REF
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
ARG PKG="github.com/distribution/distribution/v3"
|
||||||
|
ARG BUILDTAGS="include_oss include_gcs"
|
||||||
RUN --mount=type=bind,target=/src,rw \
|
RUN --mount=type=bind,target=/src,rw \
|
||||||
--mount=type=cache,target=/root/.cache/go-build \
|
--mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=target=/go/pkg/mod,type=cache \
|
--mount=type=cache,target=/go/pkg/mod \
|
||||||
go build -o /go/bin/registry ./cmd/registry
|
goreleaser-xx --debug \
|
||||||
|
--name="registry" \
|
||||||
|
--dist="/out" \
|
||||||
|
--main="./cmd/registry" \
|
||||||
|
--flags="-v" \
|
||||||
|
--ldflags="-s -w -X '$PKG/version.Version={{.Version}}' -X '$PKG/version.Revision={{.Commit}}' -X '$PKG/version.Package=$PKG'" \
|
||||||
|
--tags="$BUILDTAGS" \
|
||||||
|
--files="LICENSE" \
|
||||||
|
--files="README.md"
|
||||||
|
|
||||||
FROM $BCI_MICRO
|
FROM scratch AS artifact
|
||||||
|
COPY --from=build /out/*.tar.gz /
|
||||||
|
COPY --from=build /out/*.zip /
|
||||||
|
COPY --from=build /out/*.sha256 /
|
||||||
|
|
||||||
|
FROM scratch AS binary
|
||||||
|
COPY --from=build /usr/local/bin/registry* /
|
||||||
|
|
||||||
|
FROM bci/bci-micro
|
||||||
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
|
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
|
||||||
COPY --from=build /go/bin/registry /bin/registry
|
COPY --from=build /usr/local/bin/registry /bin/registry
|
||||||
VOLUME ["/var/lib/registry"]
|
VOLUME ["/var/lib/registry"]
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
ENTRYPOINT ["registry"]
|
ENTRYPOINT ["registry"]
|
||||||
|
Loading…
Reference in New Issue
Block a user