|
1 | | -FROM docker.io/minio/mc:latest as mc |
2 | | - |
3 | | - |
4 | 1 | FROM docker.io/drycc/go-dev:latest AS build |
5 | 2 | ARG LDFLAGS |
6 | 3 | ADD . /app |
7 | 4 | RUN export GO111MODULE=on \ |
8 | 5 | && cd /app \ |
9 | | - && CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /usr/local/bin/registry main.go \ |
| 6 | + && CGO_ENABLED=0 init-stack go build -ldflags "${LDFLAGS}" -o /usr/local/bin/registry main.go \ |
10 | 7 | && upx -9 --brute /usr/local/bin/registry |
11 | 8 |
|
12 | 9 |
|
13 | | -FROM docker.io/library/registry:2.7 |
| 10 | +FROM docker.io/drycc/base:bullseye |
| 11 | + |
| 12 | +RUN adduser --system \ |
| 13 | + --shell /bin/bash \ |
| 14 | + --disabled-password \ |
| 15 | + --home /var/lib/registry \ |
| 16 | + --group \ |
| 17 | + drycc |
14 | 18 |
|
15 | | -COPY rootfs / |
16 | | -COPY --from=mc /usr/bin/mc /bin/mc |
| 19 | +COPY rootfs/bin/ /bin/ |
| 20 | +COPY rootfs/config-example.yml /etc/docker/registry/config.yml |
17 | 21 | COPY --from=build /usr/local/bin/registry /opt/registry/sbin/registry |
| 22 | +ENV JQ_VERSION="1.6" \ |
| 23 | + MC_VERSION="2022.02.26.03.58.31" \ |
| 24 | + REGISTRY_VERSION="2.8.0" |
18 | 25 |
|
19 | | -RUN apk add --no-cache jq bash \ |
20 | | - && chmod +x /bin/create_bucket /bin/normalize_storage |
| 26 | +RUN install-stack jq $JQ_VERSION \ |
| 27 | + && install-stack mc $MC_VERSION \ |
| 28 | + && install-stack registry $REGISTRY_VERSION \ |
| 29 | + && chmod +x /bin/create_bucket /bin/normalize_storage \ |
| 30 | + && rm -rf \ |
| 31 | + /usr/share/doc \ |
| 32 | + /usr/share/man \ |
| 33 | + /usr/share/info \ |
| 34 | + /usr/share/locale \ |
| 35 | + /var/lib/apt/lists/* \ |
| 36 | + /var/log/* \ |
| 37 | + /var/cache/debconf/* \ |
| 38 | + /etc/systemd \ |
| 39 | + /lib/lsb \ |
| 40 | + /lib/udev \ |
| 41 | + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \ |
| 42 | + /usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \ |
| 43 | + && mkdir -p /usr/share/man/man{1..8} \ |
| 44 | + && chown -R drycc:drycc /var/lib/registry |
21 | 45 |
|
| 46 | +USER drycc |
22 | 47 | VOLUME ["/var/lib/registry"] |
23 | 48 | CMD ["/opt/registry/sbin/registry"] |
24 | 49 | EXPOSE 5000 |
0 commit comments