docker-machine environment to quickly build docker

Environment: Tencent cloud test is successful

Condition 1: A local host and the remote host B

2. Remote Host B, configuration-free dense Login

1,在本地主机A上生成公钥和私钥,生成命令:ssh-keygen -t rsa

  Private: id_rsa public key: id_rsa.pub


2. 把生成的公钥添加到远程主机B的认证配置中,命令:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host

3. In the Local host operations, complete the creation of a remote host B docker environment

例子1:
docker-machine create -d generic \
--generic-ip-address=192.168.22.175 \
--generic-ssh-user=root \
--engine-registry-mirror http://ef017c13.m.daocloud.io \
dockerhost

例子2:
docker-machine create \
  --driver generic \
  --generic-ip-address=203.0.113.81 \
  --generic-ssh-key ~/.ssh/id_rsa \
  vm

After the successful implementation of local docker client with the following command to connect remote server docker daeman, use the command exit to exit the remote docker environment:
eval $(docker-machine env machinename)

4. A can see the local end nodes installed

  docker-machine ls

 

 

  

 

  

Guess you like

Origin www.cnblogs.com/spotatoman/p/10987529.html