From 17b6dca91f6474be0ba7d6a1399a3f0f34f32dde Mon Sep 17 00:00:00 2001 From: Josh Mahowald Date: Wed, 16 Mar 2016 10:18:40 -0500 Subject: [PATCH 1/2] Allow eval call to set env variables --- README.md | 5 ++++- docker-vpn-helper | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 613f2f6..27b5ba1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# docker-vpn-helper +s# docker-vpn-helper ###How does Docker work on OSX? [docker-machine](https://docs.docker.com/machine/) leverages VirtualBox to create a boot2docker VM (based on Tiny Core Linux) that exposes the required kernel facilities (e.g., cgroups and namespaces) needed by the Docker daemon. The Docker client for OSX relies on the Docker daemon running within the boot2docker VM to perform all of its actions. @@ -156,6 +156,9 @@ export DOCKER_CERT_PATH=/Users/jonathan.li/.docker/machine/machines/default export DOCKER_MACHINE_NAME=default ``` + +You can rerun with eval $(docker-vpn-helper) to set your environment variables + 3. Let's make sure a VM was created ``` $ docker-machine ls diff --git a/docker-vpn-helper b/docker-vpn-helper index cdb226b..3b5573c 100755 --- a/docker-vpn-helper +++ b/docker-vpn-helper @@ -90,7 +90,7 @@ if [[ ${SERVER_PEM} != *"CN=localhost"* && ${SERVER_PEM} != *"IP:127.0.0.1"* ]]; docker-machine ssh ${B2D_MACHINE_NAME} "sudo /etc/init.d/docker restart" fi -echo "=====Add these to your environment=====" +echo "####=====Add these to your environment=====" printf "%s\n" "export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://localhost:${HOST_DOCKER_DAEMON_PORT}" export DOCKER_CERT_PATH="${DOCKER_MACHINES_HOME}/${B2D_MACHINE_NAME}" From 54f14799e08ae449c3bc54fa80e45011de9cb563 Mon Sep 17 00:00:00 2001 From: Josh Mahowald Date: Thu, 17 Mar 2016 10:16:37 -0500 Subject: [PATCH 2/2] Actually allow one to do an eval --- docker-vpn-helper | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-vpn-helper b/docker-vpn-helper index 3b5573c..13f2933 100755 --- a/docker-vpn-helper +++ b/docker-vpn-helper @@ -90,7 +90,8 @@ if [[ ${SERVER_PEM} != *"CN=localhost"* && ${SERVER_PEM} != *"IP:127.0.0.1"* ]]; docker-machine ssh ${B2D_MACHINE_NAME} "sudo /etc/init.d/docker restart" fi -echo "####=====Add these to your environment=====" +#Send this message to stderr so can evaluate it +echo "=====Add these to your environment=====" >&2 printf "%s\n" "export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://localhost:${HOST_DOCKER_DAEMON_PORT}" export DOCKER_CERT_PATH="${DOCKER_MACHINES_HOME}/${B2D_MACHINE_NAME}"