How to use “Docker Quickstart Terminal” to start another docker-machine?

主宰稳场 提交于 2019-12-19 02:59:19

问题


On my mac, when I start docker by running "Docker quickstart terminal", it will start the default docker machine.

I see in the start.sh of the docker quickstart terminal is:

#!/bin/bash

VM=default
DOCKER_MACHINE=/usr/local/bin/docker-machine
VBOXMANAGE=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage

BLUE='\033[0;34m'
GREEN='\033[0;32m'
NC='\033[0m'

... more

How can I start another docker machine without modifying this shell file?


回答1:


You simply can create a new docker machine:

docker-machine create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 my_new_machine

(replace my_new_machine)

Then you can ssh to it:

docker-machine start my_new_container
eval $($DOCKER_MACHINE env my_new_container --shell=bash)
docker-machine ssh my_new_container


来源:https://stackoverflow.com/questions/34262555/how-to-use-docker-quickstart-terminal-to-start-another-docker-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!