-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (47 loc) · 1.71 KB
/
Dockerfile
File metadata and controls
55 lines (47 loc) · 1.71 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
50
51
52
53
54
55
ARG CODENAME
FROM registry.drycc.cc/drycc/go-dev:latest AS build
ARG LDFLAGS
ADD . /workspace
RUN export GO111MODULE=on \
&& cd /workspace \
&& CGO_ENABLED=0 init-stack go build -ldflags "${LDFLAGS}" -o /bin/start-registry main.go \
&& upx -9 --brute /bin/start-registry
FROM registry.drycc.cc/drycc/base:${CODENAME}
ARG DRYCC_UID=1001 \
DRYCC_GID=1001 \
DRYCC_HOME_DIR=/var/lib/registry \
JQ_VERSION="1.7.1" \
NGINX_VERSION="1.29.1" \
RCLONE_VERSION="1.71.1" \
REGISTRY_VERSION="3.0.0"
RUN groupadd drycc --gid ${DRYCC_GID} \
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR} \
&& install-packages apache2-utils \
&& install-stack jq $JQ_VERSION \
&& install-stack nginx ${NGINX_VERSION} \
&& install-stack rclone $RCLONE_VERSION \
&& install-stack registry $REGISTRY_VERSION \
&& 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_UID}:${DRYCC_GID} /opt/drycc
COPY --from=build /bin/start-registry /bin/start-registry
COPY --chown=${DRYCC_UID}:${DRYCC_GID} rootfs/bin/ /bin/
COPY --chown=${DRYCC_UID}:${DRYCC_GID} rootfs/opt/drycc/nginx /opt/drycc/nginx
COPY --chown=${DRYCC_UID}:${DRYCC_GID} rootfs/config-example.yml /opt/drycc/registry/etc/config.yml
ENV OTEL_TRACES_EXPORTER=none \
DRYCC_REGISTRY_CONFIG=/opt/drycc/registry/etc/config.yml
USER ${DRYCC_UID}
VOLUME ["${DRYCC_HOME_DIR}"]
EXPOSE 5000