15 Commits
Author SHA1 Message Date
Swarup Sengupta d62b101336 Updated Dockerfile to use heredoc syntax, make.bash for latest psiphon release 2025-04-05 03:03:10 +05:30
swarupsengupta2007 b2d368dedd updated readme 2024-12-27 22:28:53 +05:30
swarupsengupta2007 5652183e5c updated readme 2024-12-27 22:28:12 +05:30
swarupsengupta2007 f72f5ddbea updated readme 2024-12-27 22:27:00 +05:30
swarupsengupta2007 044298117f removed default psiphon version, use make.bash instead 2024-12-27 22:09:35 +05:30
swarupsengupta2007 ac82876e54 Added heath-check to containers, upgraded psiphon to 2.0.31 2024-12-27 21:37:40 +05:30
swarupsengupta2007 f64df60fe0 updated README to include helper script decumentation 2024-05-04 20:25:11 +05:30
swarupsengupta2007 2065b1d62e updated README to include helper script decumentation 2024-05-04 20:24:40 +05:30
swarupsengupta2007 a464d3b418 updated README to include helper script decumentation 2024-05-04 20:23:54 +05:30
swarupsengupta2007 4fd631a9d3 modified make.bash to take arguments as environemt variables 2024-05-04 19:32:40 +05:30
swarupsengupta2007 33b0888580 modified Dockerfile to accept go version as build arg 2024-05-04 01:54:41 +05:30
swarupsengupta2007 5a1caa3f40 bumped go to 1.20, psiphon to 2.0.30 2024-05-04 01:43:14 +05:30
swarupsengupta2007 b7c19a8c13 added exitcode for container restart on psiphon restart 2023-06-28 22:47:41 +05:30
swarupsengupta2007 e29b256f92 Reset Dockerfile to use base version from which this project was based off. Will use build-args to build new images (make.bash) 2023-04-05 18:18:53 +05:30
swarupsengupta2007 a67d4424c3 Updated for Psiphon-2.0.29 release 2023-04-01 04:14:56 +05:30
4 changed files with 60 additions and 33 deletions
+26 -24
View File
@@ -1,33 +1,34 @@
ARG BUILDPLATFORM=$BUILDPLATFORM
FROM --platform=$BUILDPLATFORM golang:1.18 AS psiphon_builder
ARG GO_VERSION=1.24.1
FROM --platform=$BUILDPLATFORM golang:$GO_VERSION AS psiphon_builder
WORKDIR /go
LABEL stage=builder
ARG VERSION=2.0.23
ARG BUILDOS
ARG BUILDARCH
ARG TARGETS
ENV DIR=/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
GO111MODULE=off \
CGO_ENABLED=0
SHELL ["/bin/bash", "-c"]
RUN TARGET_PALTFORMS=${TARGETS:-"$BUILDOS/$BUILDARCH"} && \
mkdir -p ${DIR} && \
curl -sL https://github.com/Psiphon-Labs/psiphon-tunnel-core/archive/refs/tags/v${VERSION}.tar.gz | \
tar xz -C ${DIR} --strip-components=1 && \
(IFS=','; for PLATFORM in $TARGET_PALTFORMS; \
do \
OS=${PLATFORM%%/*} && \
ARCH=${PLATFORM#*/} && \
ARCH=${ARCH%/*} && \
VERSION=${PLATFORM##*/} && \
TARGETVARIANT=${VERSION/$ARCH/} && \
VERSION=${TARGETVER/v/} && \
GOOS=${OS} GOARCH=${ARCH} go install -a -tags netgo \
-ldflags '-w -extldflags "-static"' \
github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient && \
BINARY=$(find /go/bin/* -name "ConsoleClient*") && \
mv ${BINARY} /go/psiphon_${OS}_${ARCH}_${TARGETVARIANT}; \
done)
ARG PSIPHON_VERSION
ENV DIR=/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core
ENV GO111MODULE=off
ENV CGO_ENABLED=0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN <<__SCRIPT__
TARGET_PALTFORMS=${TARGETS:-"$BUILDOS/$BUILDARCH"}
TARGET_PALTFORMS=${TARGET_PALTFORMS//,/ }
mkdir -p ${DIR}
curl -sL https://github.com/Psiphon-Labs/psiphon-tunnel-core/archive/refs/tags/v${PSIPHON_VERSION}.tar.gz | tar xz -C ${DIR} --strip-components=1
for PLATFORM in $TARGET_PALTFORMS
do
OS=${PLATFORM%%/*}
ARCH=${PLATFORM#*/}
ARCH=${ARCH%/*}
VERSION=${PLATFORM##*/}
TARGETVARIANT=${VERSION/$ARCH/}
VERSION=${TARGETVER/v/}
GOOS=${OS} GOARCH=${ARCH} go install -a -tags netgo -ldflags '-w -extldflags "-static"' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
BINARY=$(find /go/bin/* -name "ConsoleClient*")
mv ${BINARY} /go/psiphon_${OS}_${ARCH}_${TARGETVARIANT}
done
__SCRIPT__
FROM swarupsengupta2007/alpine-s6:3.16.0
ARG TARGETOS
@@ -37,4 +38,5 @@ COPY base/ /
COPY psiphon.config ${DEF_DEFAULTS}
COPY --from=psiphon_builder /go/psiphon_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT} ${DEF_APP}/psiphon
EXPOSE 8080 1080
HEALTHCHECK --interval=30s --timeout=5s --start-period=2m --retries=3 CMD netstat -ltn|grep 1080 || exit 1
VOLUME /config
+15 -6
View File
@@ -30,15 +30,24 @@ docker buildx create --name cross-platform --platform ${TARGETS} --use
docker buildx build -t <your_tag> . --load
# build for multi-arch and push to registry
docker buildx build --build-arg TARGETS=${TARGETS} -t <your_username>/<your_tag> \
--platform ${TARGETS} . --push
# optional, choose targets (defaults to the following list)
export TARGETS="linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
# choose psiphon version
export VERSION=2.0.31
# choose go version (currently 1.22.7)
export GO_VERSION=1.22.7
# run the script
./make.bash --push
```
Build-args available
|build-arg|default|Description|
|--|--|--|
|VERSION|2.0.23|psiphon-tunnel-core release version|
|TARGETS|\<BUIDLOS\>/\<BUILDARCH\>|Targets for cross-compilation for the build stage|
|build-arg|Description|
|--|--|
|VERSION|psiphon-tunnel-core release version|
|TARGETS|\<BUIDLOS\>/\<BUILDARCH\> (Targets for cross-compilation for the build stage)|
---
# Usage
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
if test "$1" -eq 256 ; then
e=$((128 + $2))
else
e="$1"
fi
echo "$e" > /run/s6-linux-init-container-results/exitcode
+10 -3
View File
@@ -1,6 +1,13 @@
#!/bin/bash
TARGETS="linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"
MK_TARGETS=${TARGETS:-"linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6"}
MK_VERSION=${VERSION:-2.0.32}
MK_GO_VERSION=${GO_VERSION:-1.23.7}
sudo docker buildx build --build-arg TARGETS=${TARGETS} -t swarupsengupta2007/psiphon:2.0.23 \
-t swarupsengupta2007/psiphon:latest --platform ${TARGETS} . $1
docker buildx build \
--build-arg TARGETS=${MK_TARGETS} \
--build-arg PSIPHON_VERSION=${MK_VERSION} \
--build-arg GO_VERSION=${MK_GO_VERSION} \
-t swarupsengupta2007/psiphon:${MK_VERSION} \
-t swarupsengupta2007/psiphon:latest \
--platform ${MK_TARGETS} . $1