neilpang/wgcf-docker

By neilpang

Updated over 2 years ago

Image
7

1M+

neilpang/wgcf-docker repository overview

wgcf-docker

Wireguard in docker

  1. Run a single container:

docker run --rm -it \
    --name wgcf \
    --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    --privileged --cap-add net_admin \
    -v /lib/modules:/lib/modules \
    -v $(pwd):/wgcf \
    neilpang/wgcf-docker

or:

docker run --rm -it \
    --name wgcf \
    --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    --privileged --cap-add net_admin \
    -v /lib/modules:/lib/modules \
    -v $(pwd):/wgcf \
    neilpang/wgcf-docker:alpine

  1. If aonther container needs to use the wgcf network, run it like:

docker run --rm  -it  --network container:wgcf  curlimages/curl curl ipinfo.io

  1. Docker-compose example:

version: "2.4"
services:
  wgcf:
    image: neilpang/wgcf-docker:latest
    volumes:
      - ./wgcf:/wgcf
      - /lib/modules:/lib/modules
    privileged: true
    sysctls:
      net.ipv6.conf.all.disable_ipv6: 0
    cap_add:
      - NET_ADMIN
    

  test:
    image: curlimages/curl
    network_mode: "service:wgcf"
    depends_on:
      - wgcf
    command: curl ipinfo.io

    
    

or:


version: "2.4"
services:
  wgcf:
    image: neilpang/wgcf-docker:alpine
    volumes:
      - ./wgcf:/wgcf
      - /lib/modules:/lib/modules
    privileged: true
    sysctls:
      net.ipv6.conf.all.disable_ipv6: 0
    cap_add:
      - NET_ADMIN
    

  test:
    image: curlimages/curl
    network_mode: "service:wgcf"
    depends_on:
      - wgcf
    command: curl ipinfo.io

    
    

Tag summary

Content type

Image

Digest

sha256:0d69b013c

Size

38.3 MB

Last updated

over 2 years ago

docker pull neilpang/wgcf-docker