FROM golang:1.20-alpine3.18
ENV GO111MODULE=on
ENV PROJECT_NAME=tunelo
ENV GIT_REPO=https://github.com/mehdieidi/${PROJECT_NAME}.git
WORKDIR /go/src/
RUN set -x \
&& apk add git ca-certificates
RUN set -x \
&& git clone --depth=1 ${GIT_REPO} \
&& cd ${PROJECT_NAME}/ \
&& go mod tidy
RUN set -x \
&& cd ${PROJECT_NAME}/ \
&& CGO_ENABLED=0 GOOS=linux \
go build -o /tmp/${PROJECT_NAME} cmd/main.go
# ---------- 8< ----------
FROM alpine:3.18.3
# length must equal 32
# https://github.com/golang/crypto/blob/master/chacha20poly1305/chacha20poly1305.go#L17
ENV SECRET_KEY=cef55728079e8c46b73a4e2fcae31dba
RUN set -x \
# https://github.com/mehdieidi/tunelo/blob/main/cmd/main.go#L70-L73 \
&& touch .env \
&& apk add --no-cache bash ca-certificates
COPY --from=0 /tmp/tunelo /usr/bin/tunelo
ENTRYPOINT ["tunelo"]
version: '3.9'
services:
tunelo:
image: shilazi/tunelo:v0.2.0
container_name: tunelo
command: -s -vpn_port 4000 -server_ip 0.0.0.0 -server_port 4001
environment:
SECRET_KEY: cef55728079e8c46b73a4e2fcae31dba
network_mode: host
restart: unless-stopped
touch .env
export SECRET_KEY=cef55728079e8c46b73a4e2fcae31dba
tunelo -server_ip ${VPS_IP} -server_port 4001 -client_port 4000 -vpn_port 4000
In my case, it does not work well. If you need help, please goto issues.
Tips: this program will be crazy to brush the log
Content type
Image
Digest
sha256:18e81aaa5…
Size
8.7 MB
Last updated
about 3 years ago
docker pull shilazi/tunelo:v0.2.0