From 58c408cff6b30fd7df2b3693f421e19433f2f0cf Mon Sep 17 00:00:00 2001 From: xubiaolin Date: Tue, 16 Dec 2025 00:00:00 +0800 Subject: [PATCH] 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 --- .github/workflows/image-build.yml | 2 +- Dockerfile | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index c5ffb4e..176b6f5 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -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 }} \ No newline at end of file + TAG=${{ steps.get_tag.outputs.latest_tag }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a32d2dc..4862e8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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!"