1 Star 0 Fork 1

长春叭哥 / docker-zerotier-planet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Dockerfile 2.41 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2023-10-24 23:50 . update-proxy
FROM alpine:3.17 as builder
ARG ZT_PORT
ENV TZ=Asia/Shanghai
WORKDIR /app
ADD . /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk update\
&& mkdir -p /usr/include/nlohmann/ && cd /usr/include/nlohmann/ && wget https://ghproxy.markxu.online/https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp \
&& apk add --no-cache git python3 npm make g++ zerotier-one linux-headers\
&& mkdir /app -p && cd /app && git clone --progress https://ghproxy.markxu.online/https://github.com/key-networks/ztncui.git\
&& cd /app/ztncui/src \
&& cp /app/patch/binding.gyp .\
&& echo "开始配置npm环境"\
&& npm install -g --progress --verbose node-gyp --registry=https://registry.npmmirror.com\
&& npm install --registry=https://registry.npmmirror.com\
&& echo 'HTTP_PORT=3443' >.env \
&& echo 'NODE_ENV=production' >>.env \
&& echo 'HTTP_ALL_INTERFACES=true' >>.env \
&& echo "ZT_ADDR=localhost:${ZT_PORT}" >>.env\
&& echo "${ZT_PORT}" >/app/zerotier-one.port \
&& cp -v etc/default.passwd etc/passwd
RUN cd /app && git clone --progress https://ghproxy.markxu.online/https://github.com/zerotier/ZeroTierOne.git --depth 1\
&& zerotier-one -d && sleep 5s && ps -ef |grep zerotier-one |grep -v grep |awk '{print $1}' |xargs kill -9 \
&& cd /var/lib/zerotier-one && zerotier-idtool initmoon identity.public >moon.json\
&& cd /app/patch && python3 patch.py \
&& cd /var/lib/zerotier-one && zerotier-idtool genmoon moon.json && mkdir moons.d && cp ./*.moon ./moons.d \
&& cd /app/ZeroTierOne/attic/world/ && sh build.sh \
&& sleep 5s \
&& cd /app/ZeroTierOne/attic/world/ && ./mkworld \
&& mkdir /app/bin -p && cp world.bin /app/bin/planet \
&& TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) \
&& echo "ZT_TOKEN=$TOKEN">> /app/ztncui/src/.env
FROM alpine:3.17
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"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/smallyaohailu/docker-zerotier-planet.git
git@gitee.com:smallyaohailu/docker-zerotier-planet.git
smallyaohailu
docker-zerotier-planet
docker-zerotier-planet
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891