docker-zerotier-planet/Dockerfile

55 lines
1.4 KiB
Docker
Raw Normal View History

2021-11-09 11:08:51 -05:00
FROM centos:7
2021-11-09 12:06:57 -05:00
WORKDIR /var/lib/zerotier-one/
2021-11-09 11:08:51 -05:00
COPY . /var/lib/zerotier-one/
VOLUME ["/opt","/var/lib/zerotier-one"]
EXPOSE 9993
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && \
yum update -y && \
yum install git make gcc gcc-c++ python3 wget -y && \
yum install centos-release-scl -y &&\
yum install devtoolset-8 -y &&\
# 编译服务
cd /opt && \
git clone https://github.com.cnpmjs.org/zerotier/ZeroTierOne.git && \
cd ZeroTierOne && \
make && \
make install && \
# 配置moon
cd /var/lib/zerotier-one && \
zerotier-idtool generate identity.public identity.secret &&\
zerotier-idtool initmoon identity.public >> moon.json &&\
2021-11-09 11:46:04 -05:00
#配置ztncui
cd /opt &&\
curl -sL https://rpm.nodesource.com/setup_10.x | bash - &&\
yum install nodejs -y &&\
2021-11-09 12:06:57 -05:00
rm -rf ztncui/ &&\
2021-11-09 11:46:04 -05:00
git clone https://github.com.cnpmjs.org/key-networks/ztncui.git &&\
2021-11-09 12:06:57 -05:00
cd ztncui/src &&\
2021-11-09 11:46:04 -05:00
npm install -g node-gyp &&\
2021-11-09 12:06:57 -05:00
npm install &&\
sh -c "echo 'HTTP_PORT=3443' > .env"&&\
sh -c "echo 'NODE_ENV=production' >> .env"&&\
2021-11-09 11:46:04 -05:00
2021-11-09 11:08:51 -05:00
# 配置补丁
cd /var/lib/zerotier-one && \
python3 patch.py && \
zerotier-idtool genmoon moon.json && \
mkdir moons.d && cp ./*.moon ./moons.d &&\
rm -rf planet &&\
# 编译新的plane
cd /opt/ZeroTierOne/attic/world/ && \
sh build.sh &&\
mv world.bin /var/lib/zerotier-one/planet
2021-11-09 12:06:57 -05:00
CMD [ "bash","run.sh" ]
2021-11-09 11:08:51 -05:00