Last active
February 1, 2016 19:36
-
-
Save miniharryc/2107acd083f1307f9e79 to your computer and use it in GitHub Desktop.
Getting the local docker-machine IP to add to no_proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is the (brute force) way I'd thought to do it | |
eval "$(docker-machine env default)" | |
# get the IP address of our docker-machine, | |
# so we can add it to no_proxy below | |
DOCKER_IP=$(echo $DOCKER_HOST | sed 's#tcp://##' | sed 's#:.*##') | |
export no_proxy=lexmark.com,localhost,pvi.com,$DOCKER_IP | |
## this is the actual way to do it | |
eval "$(docker-machine env default --no-proxy)" |
You can use --no-proxy
flag for docker-machine env
:
$ docker-machine env --no-proxy default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/nathanleclaire/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
export NO_PROXY="192.168.99.100"
# Run this command to configure your shell:
# eval $(docker-machine env --no-proxy)
Indeed!
eval "$(docker-machine env default --no-proxy)"
Works like a charm.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bit of explanation for the above: We use an http proxy, so any time we want some traffic to a non-proxied program launched by the shell, need to add it to the
no_proxy
ENV var in my ZSH rc file.