Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Latest commit

 

History

History
42 lines (31 loc) · 1.43 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.43 KB

wgsocks

Overview

Minimalistic wireguard to socks5 wrapper container image based on Apline linux.

Build

ARGS=()
for i in $(find ./VERSIONS/ -type f); do
  ARGS+=('--build-arg' "${i##*/}=$(< $i)")
done
docker build "${ARGS[@]}" --tag ${PWD##*/} \
       --label org.opencontainers.image.created="$(date --rfc-3339 seconds --utc)" \
       --label org.opencontainers.image.version=$(< DISPLAY_VERSION) \
       --label org.opencontainers.image.revision=$(git rev-parse HEAD) .

Push image to registry:

docker tag ${PWD##*/} $CONTAINER_REGISTRY_USERNAME/${PWD##*/}:$(< DISPLAY_VERSION)
docker tag ${PWD##*/} $CONTAINER_REGISTRY_USERNAME/${PWD##*/}:latest
docker push --all-tags $CONTAINER_REGISTRY_USERNAME/${PWD##*/}

Environment variables

None

Run

docker run --detach \
       --restart always \
       --volume $PATH_TO_CONFIG:/config \
       ghcr.io/fei1yang/wgsocks:latest wgsocks -a $LOCAL_ADDR -b $SOCKS5_BIND_ADDR

The code used in SagerNet for configuration file generation is here.

Note: Podman is recommended for use this container image due to its amazing automatic update feature, please refer to the official document for further details.