Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I switch between active docker-machines on OSX?

Within MacOS, I have created 2 docker machines, say, dev1 and dev2. In one terminal running $docker-machine active shows dev1 as an active docker-machine and in the other, dev2. Now I want to switch to dev2 in the 1st terminal (without stopping/removing etc. dev1) so that I'll have dev2 in both.

How do I do this? Thanks!

like image 894
alisa Avatar asked Jan 27 '16 19:01

alisa


2 Answers

run command in your terminal eval $(docker-machine env [machine-name]) Run docker-machine ls to get available machines list

like image 62
Vaidas Lungis Avatar answered Oct 21 '22 07:10

Vaidas Lungis


So I have been researching on this for some time and what I found is that I have to run $eval "$(docker-machine env dev2)" in Terminal 1.

like image 40
alisa Avatar answered Oct 21 '22 07:10

alisa