Created
March 21, 2016 16:41
-
-
Save andyvanee/bb43a1581138cb0cb7d5 to your computer and use it in GitHub Desktop.
Export docker-machine environment variables in a makefile
This file contains hidden or 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
# | |
# Run `make ENVIRONMENT=machinename` to override the default | |
# | |
ENVIRONMENT=default | |
TLS_VERIFY=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_TLS_VERIFY=".*"' | cut -d\" -f2) | |
HOST=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_HOST=".*"' | cut -d\" -f2) | |
CERT_PATH=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_CERT_PATH=".*"' | cut -d\" -f2) | |
MACHINE_NAME=$(shell docker-machine env $(ENVIRONMENT) | grep 'DOCKER_MACHINE_NAME=".*"' | cut -d\" -f2) | |
export DOCKER_MACHINE_NAME=$(MACHINE_NAME) | |
export DOCKER_TLS_VERIFY=$(TLS_VERIFY) | |
export DOCKER_HOST=$(HOST) | |
export DOCKER_CERT_PATH=$(CERT_PATH) | |
default: | |
docker ps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment