Refactor Dockerfile and GitHub Actions workflow for improved ZeroTier build process

- Updated Dockerfile to ensure proper initialization and cleanup of zerotier-one service
- Changed working directory path for mkworld build process
- Added creation of /var/lib/zerotier-one directory
- Modified image-build.yml to use TAG instead of DERP_VERSION for build arguments
This commit is contained in:
xubiaolin
2025-12-16 00:00:00 +08:00
parent fac6121d8e
commit 58c408cff6
2 changed files with 6 additions and 4 deletions

View File

@@ -40,4 +40,4 @@ jobs:
${{ secrets.DOCKERHUB_USERNAME }}/zerotier-planet-test:latest
${{ secrets.DOCKERHUB_USERNAME }}/zerotier-planet-test:${{ steps.get_tag.outputs.latest_tag }}
build-args: |
DERP_VERSION=${{ steps.get_tag.outputs.latest_tag }}
TAG=${{ steps.get_tag.outputs.latest_tag }}

View File

@@ -27,14 +27,16 @@ RUN set -x\
&& make -j\
&& make install\
&& echo "make success!"\
; zerotier-one -d \
; sleep 5s && ps -ef |grep zerotier-one |grep -v grep |awk '{print $1}' |xargs kill -9\
&& zerotier-one -d || true\
&& sleep 5s\
&& (ps -ef |grep zerotier-one |grep -v grep |awk '{print $1}' |xargs kill -9 || true)\
&& echo "zerotier-one init success!"\
&& cd ./attic/world \
&& cd /app/ZeroTierOne/attic/world \
&& cp /app/patch/mkworld_custom.cpp .\
&& mv mkworld.cpp mkworld.cpp.bak \
&& mv mkworld_custom.cpp mkworld.cpp \
&& sh build.sh \
&& mkdir -p /var/lib/zerotier-one \
&& mv mkworld /var/lib/zerotier-one\
&& echo "mkworld build success!"