Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow eval call to set env variables #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-vpn-helper
s# docker-vpn-helper
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's an extra char here


###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.
Expand Down Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make more sense to:

  1. insert this between the existing steps 3 and 4
  2. update the existing step 4 to note that the explicit exports are not required if you re-ran the script with eval $(./docker-vpn-helper)


3. Let's make sure a VM was created
```
$ docker-machine ls
Expand Down
3 changes: 2 additions & 1 deletion docker-vpn-helper
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down