发布网友 发布时间:2022-04-22 07:11
共2个回答
热心网友 时间:2022-04-11 10:31
下载最近版的Docker for OS X Installer。
运行安装程序, 安装VirtualBox和Boot2Docker管理工具。
运行应用程序文件夹下的Boot2Docker应用:
或者手动初始化Boot2Docker,打开终端并运行:
$ boot2docker init
$ boot2docker start
$ export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
一旦初始化化好了一个虚拟机,就能用boot2docker stop和boot2docker start来进行控制。
热心网友 时间:2022-04-11 11:49
额 没懂你的意思 但是我一般的使用方式都是先打开bash,然后:
Last login: Fri Jan 15 01:32:29 on ttys003
[01:34 AM morganwu@ localhost log]$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
kube-dev - virtualbox Stopped
[01:34 AM morganwu@ localhost log]$ docker-machine start kube-dev
(kube-dev) OUT | Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
[01:36 AM morganwu@ localhost log]$ docker-machine env kube-dev
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/morganwu/.docker/machine/machines/kube-dev"
export DOCKER_MACHINE_NAME="kube-dev"
# Run this command to configure your shell:
# eval "$(docker-machine env kube-dev)"
[01:36 AM morganwu@ localhost log]$ eval "$(docker-machine env kube-dev)"
[01:36 AM morganwu@localhost log]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES