1
0
Fork 0

use golang-specific builder
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Daniel Wolf 2023-04-17 12:02:21 -04:00
parent b43d53b128
commit de64f0442f
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
1 changed files with 7 additions and 11 deletions

View File

@ -1,28 +1,24 @@
FROM nephatrine/nxbuilder:alpine AS builder
FROM nephatrine/nxbuilder:golang AS builder
ARG GOPATH="/usr"
ARG BUILDTAGS="include_oss include_gcs"
ARG REGISTRY_VERSION=main
ARG REGCLIENT_VERSION=releases/0.4
RUN mkdir -p /usr/src/github.com/distribution \
&& git -C /usr/src/github.com/distribution clone -b "$REGISTRY_VERSION" --single-branch --depth=1 https://github.com/distribution/distribution.git
RUN git -C /usr/src clone -b "$REGCLIENT_VERSION" --single-branch --depth=1 https://github.com/regclient/regclient.git
RUN git -C ${HOME} clone -b "$REGISTRY_VERSION" --single-branch --depth=1 https://github.com/distribution/distribution.git
RUN git -C ${HOME} clone -b "$REGCLIENT_VERSION" --single-branch --depth=1 https://github.com/regclient/regclient.git
RUN echo "====== COMPILE REGISTRY ======" \
&& cd /usr/src/github.com/distribution/distribution \
&& go build -trimpath -ldflags "-s -w" -o /usr/bin/registry ./cmd/registry
&& cd ${HOME}/distribution && go build -trimpath -ldflags "-s -w" -o /usr/bin/registry ./cmd/registry
RUN echo "====== COMPILE REGCLIENT ======" \
&& cd /usr/src/regclient \
&& make binaries -j4
&& cd ${HOME}/regclient && make binaries -j4
FROM nephatrine/alpine-s6:latest
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
RUN mkdir /etc/registry
COPY --from=builder /usr/bin/registry /usr/bin/registry
COPY --from=builder /usr/src/regclient/bin/ /usr/local/bin/
COPY --from=builder /usr/src/github.com/distribution/distribution/cmd/registry/config-example.yml /etc/registry/config-example.yml
COPY --from=builder /root/regclient/bin/ /usr/local/bin/
COPY --from=builder /root/distribution/cmd/registry/config-example.yml /etc/registry/config-example.yml
COPY override /
RUN echo "====== CONFIGURE REGISTRY ======" \