Skip to content

Commit

Permalink
Merge pull request #305 from PassiveLemon/ZeroTierFix
Browse files Browse the repository at this point in the history
Fix: Build older version of ZeroTier
  • Loading branch information
tobychui authored Sep 15, 2024
2 parents 8b4c601 + dfda3fe commit 465f332
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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/

Expand Down

0 comments on commit 465f332

Please sign in to comment.