|
@@ -22,15 +22,17 @@ RUN apt update -y && \
|
|
|
# BUILD GO UTILS
|
|
|
FROM golang:buster AS argong
|
|
|
WORKDIR /buildsrc
|
|
|
-COPY argon2g.go .
|
|
|
+COPY argon2g ./
|
|
|
RUN mkdir -p binaries && \
|
|
|
- go get -u golang.org/x/crypto/argon2 && \
|
|
|
- go build -ldflags='-s -w' -trimpath -o binaries/argon2g ./argon2g.go && \
|
|
|
+ cd argon2g && \
|
|
|
+ go mod download && \
|
|
|
+ go build -ldflags='-s -w' -trimpath -o ../binaries/argon2g && \
|
|
|
+ cd .. && \
|
|
|
git clone https://github.com/jsha/minica && \
|
|
|
cd minica && \
|
|
|
go mod download && \
|
|
|
go build -ldflags='-s -w' -trimpath -o ../binaries/minica && \
|
|
|
- cd ../ && \
|
|
|
+ cd .. && \
|
|
|
git clone https://github.com/tianon/gosu && \
|
|
|
cd gosu && \
|
|
|
go mod download && \
|
|
@@ -40,7 +42,7 @@ RUN mkdir -p binaries && \
|
|
|
# START RUNNER
|
|
|
FROM debian:sid-slim AS runner
|
|
|
RUN apt update -y && \
|
|
|
- apt install curl gnupg2 ca-certificates unzip supervisor --no-install-recommends -y && \
|
|
|
+ apt install curl gnupg2 ca-certificates unzip supervisor net-tools --no-install-recommends -y && \
|
|
|
curl -sL -o ztone.sh https://install.zerotier.com && \
|
|
|
bash ztone.sh && \
|
|
|
rm -f ztone.sh && \
|
|
@@ -56,12 +58,19 @@ RUN unzip ./artifact.zip && \
|
|
|
COPY --from=argong /buildsrc/binaries/gosu /bin/gosu
|
|
|
COPY --from=argong /buildsrc/binaries/minica /usr/local/bin/minica
|
|
|
COPY --from=argong /buildsrc/binaries/argon2g /usr/local/bin/argon2g
|
|
|
-COPY entrypoint.sh /entrypoint.sh
|
|
|
+
|
|
|
+COPY start_zt1.sh /start_zt1.sh
|
|
|
+COPY start_ztncui.sh /start_ztncui.sh
|
|
|
COPY supervisord.conf /etc/supervisord.conf
|
|
|
|
|
|
+RUN chmod 4755 /bin/gosu && \
|
|
|
+ chmod 0755 /usr/local/bin/minica && \
|
|
|
+ chmod 0755 /usr/local/bin/argon2g && \
|
|
|
+ chmod 0755 /start_*.sh
|
|
|
+
|
|
|
EXPOSE 3000
|
|
|
EXPOSE 9993
|
|
|
|
|
|
VOLUME ["/opt/key-networks/ztncui/etc"]
|
|
|
VOLUME [ "/var/lib/zerotier-one" ]
|
|
|
-ENTRYPOINT [ "/entrypoint.sh" ]
|
|
|
+ENTRYPOINT [ "/usr/bin/supervisord" ]
|