摘要
Windows下启动docker-machine
1 2
| docker-machine start docker-machine env | Invoke-Expression
|
查看vm主机环境
1 2 3 4 5 6 7
| [root@node2 ~] export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/root/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default"
|
管理vm主机
docker-machine常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| docker-machine config docker-machine env docker-machine inspect docker-machine ip docker-machine kill docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url
|
Docker-machine源的配置
1 2 3 4 5 6 7 8
| #!/bin/bash
for NODE in `seq 1 5` do docker-machine scp /etc/docker/daemon.json node-${NODE}:/home/docker docker-machine ssh node-${NODE} 'sudo mv /home/docker/daemon.json /etc/docker/daemon.json && sudo chown root:root /etc/docker/daemon.json && sudo kill -SIGHUP $(pidof dockerd)' done
|
参考:
https://www.jianshu.com/p/a40c07f9f456