diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 0c3aec0a..139eb997 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -8,10 +8,9 @@ on: - '*' paths: - '**.sh' - - "Dockerfile" + - "docker/**" - '.github/workflows/dockerhub.yml' - jobs: CheckToken: runs-on: ubuntu-latest @@ -30,7 +29,7 @@ jobs: fi - name: Check the value run: echo ${{ steps.step_one.outputs.hasToken }} - + build: runs-on: ubuntu-latest needs: CheckToken diff --git a/Dockerfile b/docker/Dockerfile similarity index 83% rename from Dockerfile rename to docker/Dockerfile index 049649f6..46e6db51 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -62,14 +62,7 @@ RUN for verb in help \ printf -- "%b" "#!/usr/bin/env sh\n/root/.acme.sh/acme.sh --${verb} --config-home /acme.sh \"\$@\"" >/usr/local/bin/--${verb} && chmod +x /usr/local/bin/--${verb} \ ; done -RUN printf "%b" '#!'"/usr/bin/env sh\n \ -if [ \"\$1\" = \"daemon\" ]; then \n \ - trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \ - crond && sleep infinity &\n \ - wait \n \ -else \n \ - exec -- \"\$@\"\n \ -fi" >/entry.sh && chmod +x /entry.sh +COPY entry.sh / VOLUME /acme.sh diff --git a/docker/entry.sh b/docker/entry.sh new file mode 100755 index 00000000..f5bfe234 --- /dev/null +++ b/docker/entry.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +if [ "$1" = "daemon" ]; then + trap "echo stop && killall crond && exit 0" SIGTERM SIGINT + crond && sleep infinity & + wait +else + exec -- "$@" +fi