File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM minio/mc:latest as mc
2+
3+
4+ FROM drycc/go-dev:latest AS build
5+ ARG LDFLAGS
6+ ADD . /app
7+ RUN export GO111MODULE=on \
8+ && cd /app \
9+ && CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /usr/local/bin/registry main.go \
10+ && upx -9 --brute /usr/local/bin/registry
11+
12+
13+ FROM registry:2.7
14+
15+ COPY rootfs /
16+ COPY --from=mc /usr/bin/mc /bin/mc
17+ COPY --from=build /usr/local/bin/registry /opt/registry/sbin/registry
18+
19+ RUN apk add --no-cache jq bash \
20+ && chmod +x /bin/create_bucket /bin/normalize_storage
21+
22+ VOLUME ["/var/lib/registry" ]
23+ CMD ["/opt/registry/sbin/registry" ]
24+ EXPOSE 5000
Original file line number Diff line number Diff line change 33# - Docker image name
44# - Kubernetes service, deployment, pod names
55SHORT_NAME := registry
6+ PLATFORM ?= linux/amd64,linux/arm64
67
78include includes.mk versioning.mk
89
@@ -36,10 +37,13 @@ build: check-docker
3637
3738# For cases where we're building from local
3839# We also alter the RC file to set the image name.
39- docker-build : check-docker build
40- docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
40+ docker-build : check-docker
41+ docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} --build-arg LDFLAGS= ${LDFLAGS} .
4142 docker tag ${IMAGE} ${MUTABLE_IMAGE}
4243
44+ docker-buildx : check-docker
45+ docker buildx build --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS=${LDFLAGS} . --push
46+
4347build-binary :
4448 ${DEV_ENV_CMD} go build -ldflags ${LDFLAGS} -o $(BINDIR ) /${SHORT_NAME} main.go
4549 $(call check-static-binary,$(BINDIR ) /${SHORT_NAME})
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments