How to switch between active docking stations on OSX?

On macOS, I created 2 docker machines, say dev1 and dev2. In one terminal with the launch of $docker-machine active , dev1 is displayed as the active docker machine, and in the other, dev2. Now I want to switch to dev2 in the 1st terminal (without stopping / deleting, etc. Dev1), so I will have dev2 in both.

How can I do it? Thank you

+6
source share
3 answers

execute the command in the terminal eval $(docker-machine env [machine-name]) Run docker-machine ls to get a list of available machines.

+11
source

So I did this research for a while and found that I needed to run $eval "$(docker-machine env dev2)" in terminal 1.

+1
source

You can do this with the docker-machine env . For instance:

 $ eval "$(docker-machine env <machine-name>)" 

This will set the environment variables that the Docker client will read, which sets the TLS settings. Please note that you will need to do this every time you open a new tab or restart the computer.

To find out what will be installed, run docker-machine env

 $ docker-machine env <machine-name> export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://172.16.62.130:2376" export DOCKER_CERT_PATH="/Users/<your username>/.docker/machine/machines/dev" export DOCKER_MACHINE_NAME="dev" 
0
source

All Articles