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