mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-19 10:01:24 +00:00
vpnkit-forwarder: add /pkg/vpnkit-forwarder
Adds /pkg/vpnkit-forwarder which downloads and builds vpnkit-forwarder and vpnkit-expose-port from moby/vpnkit. Also includes an example for forwarding `sshd` and updates the documentation for `hyperkit` to include a `vpnkit` section. `vpnkit` still requires a 9P mount for coordination, so the `socat` forwarding is simpler to set up at the moment. Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
16
pkg/vpnkit-forwarder/Dockerfile
Normal file
16
pkg/vpnkit-forwarder/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM linuxkit/alpine:630ee558e4869672fae230c78364e367b8ea67a9 AS mirror
|
||||
|
||||
RUN apk add --no-cache go musl-dev git build-base
|
||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||
ENV COMMIT=2d6d82167cf81c665c05d1425a79adfbc1a71177
|
||||
|
||||
RUN git clone https://github.com/moby/vpnkit.git /go/src/github.com/moby/vpnkit && \
|
||||
cd /go/src/github.com/moby/vpnkit && \
|
||||
git checkout $COMMIT && \
|
||||
cd go && \
|
||||
make all
|
||||
|
||||
FROM scratch
|
||||
COPY --from=mirror /go/src/github.com/moby/vpnkit/go/build/vpnkit-forwarder.linux /vpnkit-forwarder
|
||||
COPY --from=mirror /go/src/github.com/moby/vpnkit/go/build/vpnkit-expose-port.linux /vpnkit-expose-port
|
||||
CMD ["/vpnkit-forwarder"]
|
15
pkg/vpnkit-forwarder/Makefile
Normal file
15
pkg/vpnkit-forwarder/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
default: push
|
||||
|
||||
ORG?=linuxkit
|
||||
IMAGE=vpnkit-forwarder
|
||||
DEPS=$(wildcard *.go) Makefile Dockerfile
|
||||
|
||||
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
|
||||
|
||||
tag: $(DEPS)
|
||||
docker build --squash --no-cache -t $(ORG)/$(IMAGE):$(HASH) .
|
||||
|
||||
push: tag
|
||||
DOCKER_CONTENT_TRUST=1 docker pull $(ORG)/$(IMAGE):$(HASH) || \
|
||||
DOCKER_CONTENT_TRUST=1 docker push $(ORG)/$(IMAGE):$(HASH)
|
||||
|
9
pkg/vpnkit-forwarder/README.md
Normal file
9
pkg/vpnkit-forwarder/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
### vpnkit-forwarder
|
||||
|
||||
This package provides `vpnkit-forwarder` and `vpnkit-expose-port` from [vpnkit](http://github.com/moby/vpnkit.git).
|
||||
|
||||
`vpnkit-forwarder` is a forwarding daemon used by Docker for Desktop to forward ports from Docker containers to the host via VSOCK.
|
||||
|
||||
`vpnkit-expose-port` is a userland proxy that opens ports by demand.
|
||||
|
||||
To coordinate with `vpnkit` both tools require access to the 9P port configuration mount point.
|
Reference in New Issue
Block a user