cloudflare / cloudflare/boringtun

Add Dockerfile / Docker Hub CI

Open
#38 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
7.2k
Forks
532
PR merge metrics
No merged PRs in 30d

Description

I'd love to run this application inside a docker container.
I ran wireguard-go inside a docker container in the past, i believe this is possible with this project as well.
In an example use case, the only additional requirements are adding the required capabilites via `docker run --cap-add=NET_ADMIN --device=/dev/net/tun [...]` for wireguard to create the tunnel interface.

Dockerfile from my wireguard-go docker image:

```Dockerfile
# Build container
FROM golang:alpine AS builder

WORKDIR /src
COPY ./wireguard-go /src
RUN apk add --no-cache git make && make

# Runtime container
FROM alpine:latest

WORKDIR /app
COPY --from=builder /src/wireguard-go /app

ENV WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1 \
LOG_LEVEL=info \
WG_INTERFACE=wg0

ENTRYPOINT /app/wireguard-go --foreground $WG_INTERFACE
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.