From 4520daa753fb07a57c91132dcdeab68318bf852f Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Fri, 7 Apr 2017 15:21:23 +0100 Subject: [PATCH] demo: Updated docs and added socat forwarding container Signed-off-by: Rolf Neugebauer --- projects/demo/README.md | 13 +++++++++++++ projects/demo/dockerfiles/Dockerfile.socat | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 projects/demo/dockerfiles/Dockerfile.socat diff --git a/projects/demo/README.md b/projects/demo/README.md index e43aa909a..e62e07024 100644 --- a/projects/demo/README.md +++ b/projects/demo/README.md @@ -27,6 +27,19 @@ cp Contents/MacOS/vpnkit /Applications/Docker.app/Contents/Resources/bin/ Restart Docker for Mac. +# Local setup + +We use a `socat` container to forward ports from the VM to localhost (via Docker for Mac), to make it easier to access some VMs. To build +``` +(cd dockerfiles; docker build -t socat -f Dockerfile.socat .) +``` +And then run: +``` +docker run --rm -t -d -p 8080:8080 socat tcp-listen:8080,reuseaddr,fork tcp:192.168.65.100:80 +``` +This forwards local port `8080` to `192.168.65.100:80`, so if you start, say the `intro` image, run `moby run -ip 196.168.65.100 intro` + + # GCP Setup You probably want to change the project/zone diff --git a/projects/demo/dockerfiles/Dockerfile.socat b/projects/demo/dockerfiles/Dockerfile.socat new file mode 100644 index 000000000..8f1c78731 --- /dev/null +++ b/projects/demo/dockerfiles/Dockerfile.socat @@ -0,0 +1,8 @@ +# A dockerfile to build a socat container +# +# It sets the environment to talk to the local cluster +FROM alpine:edge + +RUN apk add --no-cache socat + +ENTRYPOINT [ "/usr/bin/socat" ]