mirror of
https://github.com/xubiaolin/docker-zerotier-planet.git
synced 2025-01-22 12:48:14 -05:00
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
FROM alpine:latest
|
|
|
|
ADD ./run.sh /app/
|
|
ADD ./patch /opt/patch/
|
|
|
|
VOLUME ["/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 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 &&\
|
|
echo 'HTTP_PORT=3443' > .env&&\
|
|
echo 'NODE_ENV=production' >> .env &&\
|
|
echo 'HTTP_ALL_INTERFACES=true' >> .env &&\
|
|
|
|
# 添加补丁
|
|
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 &&\
|
|
|
|
cp /opt/patch/* . &&\
|
|
python3 patch.py &&\
|
|
zerotier-idtool genmoon moon.json &&\
|
|
mkdir moons.d && cp ./*.moon ./moons.d &&\
|
|
|
|
rm /opt/ZeroTierOne/attic/world/mkworld.cpp &&\
|
|
cp mkworld.cpp /opt/ZeroTierOne/attic/world/ &&\
|
|
cd /opt/ZeroTierOne/attic/world/ && \
|
|
sh build.sh
|
|
|
|
WORKDIR /app/
|
|
CMD ["sh","./run.sh"]
|