mirror of
https://github.com/xubiaolin/docker-zerotier-planet.git
synced 2025-01-22 12:48:14 -05:00
简化镜像大小
* feat: 🎸 简化镜像大小 * feat: 🎸 fix port * feat: 🎸 add volume * feat: 🎸 del volume * feat: 🎸 fix --------- Co-authored-by: xubiaolin <xubiaolin2014@xiaochuankeji.cn>
This commit is contained in:
parent
460fa6dc1c
commit
87a4432051
15
Dockerfile
15
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest as builder
|
||||||
|
|
||||||
ARG ZT_PORT
|
ARG ZT_PORT
|
||||||
|
|
||||||
@ -35,5 +35,18 @@ RUN cd /app && git clone -v https://ghproxy.com/https://github.com/zerotier/Zero
|
|||||||
&& TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) \
|
&& TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) \
|
||||||
&& echo "ZT_TOKEN=$TOKEN">> /app/ztncui/src/.env
|
&& echo "ZT_TOKEN=$TOKEN">> /app/ztncui/src/.env
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /app/ztncui /app/ztncui
|
||||||
|
COPY --from=builder /app/bin /app/bin
|
||||||
|
COPY --from=builder /app/zerotier-one.port /app/zerotier-one.port
|
||||||
|
COPY --from=builder /var/lib/zerotier-one /var/lib/zerotier-one
|
||||||
|
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
|
||||||
|
&& apk update\
|
||||||
|
&& apk add --no-cache npm zerotier-one
|
||||||
|
|
||||||
|
VOLUME [ "/app","/var/lib/zerotier-one" ]
|
||||||
|
|
||||||
CMD /bin/sh -c "cd /var/lib/zerotier-one && ./zerotier-one -p`cat /app/zerotier-one.port` -d; cd /app/ztncui/src;npm start"
|
CMD /bin/sh -c "cd /var/lib/zerotier-one && ./zerotier-one -p`cat /app/zerotier-one.port` -d; cd /app/ztncui/src;npm start"
|
||||||
|
Loading…
Reference in New Issue
Block a user