/docker-wireguard-server

Recipe to build the WireGuard server Docker image

Primary LanguageDockerfileMIT LicenseMIT

WireGuard server Docker image

About

WireGuard server in the Docker container.

Upstream Links

Quick Start

  • Prepare Docker host kernel

    • The WireGuard kernel module must be available in Docker host kernel
    • See official installation instructions, usually, it is as trivial as:
      sudo apt install wireguard
  • Configure environment:

    • WIREGUARD_SERVER_PORT: the WireGuard server listening port number, make sure to use same value in the config file

        export WIREGUARD_SERVER_PORT=51820
    • WIREGUARD_SERVER_CONFIG: path to config file:

        export WIREGUARD_SERVER_CONFIG="<path-to-wireguard-config-file>"
    • DOCKER_REGISTRY: [OPTIONAL] registry prefix to pull image from a custom Docker registry:

        export DOCKER_REGISTRY="my_registry_hostname:5000/"
  • Pull prebuilt Docker image:

      docker-compose pull
  • Start prebuilt image:

      docker-compose up -d
  • Stop/Restart:

      docker-compose stop
      docker-compose start

Build own image

  • default target platform:

      cd <path to sources>
      DOCKER_BUILDKIT=1 docker build --tag <tag name> .
  • arm/v6 target platform:

      cd <path to sources>
      DOCKER_BUILDKIT=1 docker build --platform=linux/arm/v6 --tag <tag name> .