docker-zerotier-planet/Dockerfile

44 lines
1.3 KiB
Docker
Raw Normal View History

2021-11-21 03:53:20 -05:00
FROM alpine:latest
2021-11-09 11:08:51 -05:00
2021-11-21 03:53:20 -05:00
ADD ./run.sh /app/
ADD ./patch /opt/patch/
2021-11-09 11:08:51 -05:00
2021-11-21 03:53:20 -05:00
VOLUME ["/var/lib/zerotier-one/"]
2021-11-09 11:08:51 -05:00
2021-11-21 03:53:20 -05:00
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
apk update &&\
apk add git python3 nodejs npm make g++ linux-headers zerotier-one &&\
npm config set registry http://registry.npm.taobao.org &&\
# 安装ztncui
cd /opt && git clone https://github.com.cnpmjs.org/key-networks/ztncui.git &&\
cd ztncui/src && npm install -g node-gyp && npm install &&\
cp -pv ./etc/default.passwd ./etc/passwd &&\
2021-11-21 03:53:20 -05:00
echo 'HTTP_PORT=3443' > .env&&\
echo 'NODE_ENV=production' >> .env &&\
echo 'HTTP_ALL_INTERFACES=true' >> .env &&\
# 添加补丁
2021-11-09 11:08:51 -05:00
cd /opt && \
git clone https://github.com.cnpmjs.org/zerotier/ZeroTierOne.git && \
cd /var/lib/zerotier-one && \
zerotier-idtool generate identity.public identity.secret &&\
zerotier-idtool initmoon identity.public >> moon.json &&\
2021-11-21 03:53:20 -05:00
cp /opt/patch/* . &&\
python3 patch.py &&\
2021-11-27 09:03:43 -05:00
zerotier-idtool genmoon moon.json &&\
mkdir moons.d && cp ./*.moon ./moons.d &&\
2021-11-21 03:53:20 -05:00
rm /opt/ZeroTierOne/attic/world/mkworld.cpp &&\
cp mkworld.cpp /opt/ZeroTierOne/attic/world/ &&\
2021-11-09 11:08:51 -05:00
cd /opt/ZeroTierOne/attic/world/ && \
sh build.sh &&\
2021-11-21 03:53:20 -05:00
cp ./world.bin /var/lib/zerotier-one/planet
2021-11-09 11:08:51 -05:00
2021-11-21 03:53:20 -05:00
WORKDIR /app/
CMD ["sh","./run.sh"]