From dae510ae0adec4209636910dc2aa95f335b71f8b Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Fri, 28 Jul 2023 10:22:22 -0400 Subject: [PATCH 1/3] doc: VERSION --- docker/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 8d981ce..3e7879b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,3 +1,5 @@ +# [zoraxy-docker](https://github.com/tobychui/zoraxy/)
+ [![Repo](https://img.shields.io/badge/Docker-Repo-007EC6?labelColor-555555&color-007EC6&logo=docker&logoColor=fff&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker) [![Version](https://img.shields.io/docker/v/passivelemon/zoraxy-docker/latest?labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker) [![Size](https://img.shields.io/docker/image-size/passivelemon/zoraxy-docker/latest?sort=semver&labelColor-555555&color-007EC6&style=flat-square)](https://hub.docker.com/r/passivelemon/zoraxy-docker) @@ -38,13 +40,13 @@ services: | `-p (ports)` | Yes | Depending on how your network is setup, you may need to portforward 80, 443, and the management port. | | `-v (path to storage directory):/zoraxy/config/` | Recommend | Sets the folder that holds your files. This should be the place you just chose. By default, it will create a Docker volume for the files for persistency but they will not be accessible. | | `-e ARGS=(your arguments)` | No | Sets the arguments to run Zoraxy with. Enter them as you would normally. By default, it is ran with `-port=:8000 -noauth=false` | -| `-e VERSION=(version)` | Recommended | Sets the version of Zoraxy that the container will download. Must be a supported release found on the Zoraxy GitHub. Defaults to the latest if not set. | +| `-e VERSION=(version)` | Recommended | Sets the version of Zoraxy that the container will download. Must be a supported release found on the Zoraxy GitHub. Make sure that it is not set to the containers version. Defaults to the latest if not set. | | `passivelemon/zoraxy-docker:latest` | Yes | The repository on Docker hub. By default, it is the latest version that I have published. | ## Examples:
### Docker Run
``` -docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8000/tcp -v /home/docker/Containers/Zoraxy:/zoraxy/config/ -e ARGS="-port=:8000 -noauth=false" passivelemon/zoraxy-docker:latest +docker run -d --name zoraxy -p 80:80 -p 443:443 -p 8005:8000/tcp -v /home/docker/Containers/Zoraxy:/zoraxy/config/ -e ARGS="-port=:8000 -noauth=false" -e VERSION="2.6.5" passivelemon/zoraxy-docker:latest ``` ### Docker Compose
@@ -62,4 +64,5 @@ services: - /home/docker/Containers/Zoraxy:/zoraxy/config/ environment: ARGS: '-port=:8000 -noauth=false' + VERSION: '2.6.5' ``` From 7d91e02dc9d05ee41101a6e1203bf4afe4f0f76a Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Fri, 28 Jul 2023 10:22:46 -0400 Subject: [PATCH 2/3] feature: golang specific image smaller size --- docker/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 98789fb..1b742f5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,6 @@ -FROM alpine:latest +FROM docker.io/golang:1.21rc3-alpine3.18 -RUN apk update && apk upgrade &&\ - apk add bash curl jq git go sudo +RUN apk add --no-cache bash curl jq git sudo RUN mkdir -p /zoraxy/source/ &&\ mkdir -p /zoraxy/config/ @@ -14,7 +13,7 @@ COPY notifier.sh /zoraxy/ RUN chmod 755 /zoraxy/ &&\ chmod +x /zoraxy/entrypoint.sh -ENV DOCKER="2.0.0" +ENV DOCKER="2.1.0" ENV NOTIFS="1" ENV VERSION="latest" From f304ff8862b6c94562e0238e5c7ab0510d5da040 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Fri, 28 Jul 2023 10:23:20 -0400 Subject: [PATCH 3/3] feature: network connectivity test --- docker/entrypoint.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ec69888..871d2bd 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +echo "|| Testing connectivity... ||" +if ! curl -sSf https://www.github.com > /dev/null; then + echo "|| GitHub could not be reached. Please check your internet connection and try again. ||" + exit +fi if [ "$(curl -s "https://api.github.com/repos/tobychui/zoraxy/git/refs/tags" | jq 'any(.[] | tostring; test("API rate limit exceeded"))')" = "true" ]; then echo "|| Currently rate limited by GitHub. Please wait until it clears. ||" exit @@ -34,7 +39,7 @@ fi if [ ! -f "/zoraxy/server/zoraxy_bin_${VERSION}" ]; then echo "|| Cloning repository... ||" cd /zoraxy/source/ - git clone --depth=1 --branch main https://github.com/tobychui/zoraxy + git clone --depth 1 --single-branch --branch main https://github.com/tobychui/zoraxy cd /zoraxy/source/zoraxy/src/ echo "|| Building... ||" go mod tidy