使用 Docker Machine 添加机器记录

3台虚拟机

配置:4CPU 8G 80G

  • 192.168.1.76 master
  • 192.168.1.85 salve1
  • 192.168.1.127 salve2

步骤

  • 使用ssh-copy-id配置免密登录
  • docker-machine create --driver generic --generic-ip-address=192.168.1.76 master
    安装过程中卡住
    Running pre-create checks...
    Creating machine...
    (master) No SSH key specified. Assuming an existing key at the default location.
    Waiting for machine to be running, this may take a few minutes...
    Detecting operating system of created instance...
    Waiting for SSH to be available...
    Detecting the provisioner...
    Provisioning with centos...

手动安装步骤

# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#docker-ce.repo 中下载地址还是docker.com 速度极慢,甚至无法访问
#打开docker-ce.repo 通过 `%s/download-stage.docker.com/mirrors.aliyun.com\/docker-ce` 替换url
# Step 3: 更新并安装 Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务

参考资料

猜你喜欢

转载自my.oschina.net/u/261246/blog/1802114