I am trying to run a simple shell script to automate changes to the docker environment. The problem is that when I run the following command directly on a Mac terminal, the following is output:
eval $(docker-machine env default)
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * digitalocean Running tcp:
So basically what you expect, however, when I run the following .sh script:
#!/usr/bin/env bash
eval $(docker-machine env default)
Conclusion:
./run.sh
docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default digitalocean Running tcp://***.**.***.***:**** v1.12.0
Basically, he does not set it as active, and I cannot access it.
Has anyone encountered this problem before and knows how to solve it? It seems to be really strange, I have everything that works and is automated separately from this facet.
Cheers, Aaron
source
share