From dfda3fe94b7a4d3d2e285edd33780a8673cd540e Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Sat, 14 Sep 2024 01:23:17 -0400 Subject: [PATCH] Fix: Build older version of ZeroTier Anything from 1.12.0+ just doesn't work on Zoraxy --- docker/Dockerfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5a72f8a..5533f56 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/golang:alpine AS build +FROM docker.io/golang:alpine AS build-zoraxy RUN mkdir -p /opt/zoraxy/source/ &&\ mkdir -p /usr/local/bin/ @@ -12,17 +12,31 @@ RUN go mod tidy &&\ go build -o /usr/local/bin/zoraxy &&\ chmod 755 /usr/local/bin/zoraxy -FROM docker.io/alpine:latest +FROM docker.io/ubuntu:latest AS build-zerotier -WORKDIR /opt/zoraxy/source/ +RUN mkdir -p /opt/zerotier/source/ &&\ + mkdir -p /usr/local/bin/ + +WORKDIR /opt/zerotier/source/ + +RUN apt-get update -y &&\ + apt-get install -y curl jq build-essential pkg-config clang cargo libssl-dev + +RUN curl -Lo ZeroTierOne.tar.gz https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/refs/tags/1.10.6 &&\ + tar -xzvf ZeroTierOne.tar.gz &&\ + cd ZeroTierOne-* &&\ + make &&\ + mv ./zerotier-one /usr/local/bin/zerotier-one &&\ + chmod 755 /usr/local/bin/zerotier-one + +FROM docker.io/ubuntu:latest -RUN apk add --no-cache bash netcat-openbsd sudo &&\ - wget https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/zerotier-one-1.10.2-r0.apk &&\ - apk add --no-cache zerotier-one-1.10.2-r0.apk &&\ - rm -r /opt/zoraxy/source/ +RUN apt-get update -y &&\ + apt-get install -y bash sudo netcat-openbsd libssl-dev -COPY --from=build /usr/local/bin/zoraxy /usr/local/bin/zoraxy COPY --chmod=700 ./entrypoint.sh /opt/zoraxy/ +COPY --from=build-zoraxy /usr/local/bin/zoraxy /usr/local/bin/zoraxy +COPY --from=build-zerotier /usr/local/bin/zerotier-one /usr/local/bin/zerotier-one WORKDIR /opt/zoraxy/config/