docker使用说明

1. mac版配置直接在应用的Preferences里,daemon标签下可以设置国内镜像源,私有registry地址

2.退出再打开docker后或者卸载再重装,原镜像文件不存在了;restart方式则可以保留原有镜像

3.有关跨主机的容器互联网络的配置可以参考 http://blog.csdn.net/happyanger6/article/details/71104577,

docker使用过程中的各种坑 http://blog.csdn.net/gezhonglei2007/article/details/50656418

4.swarm初始化: single-host mode——>swarm mode

$ docker swarm init
Swarm initialized: current node (o1j1s62c391tvwbz5bdgqqfsu) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-5n0w79aurs92lobw0qgku0a8hs9zo4d4tuztzk3y9087oc2exa-1upwu9elxpkpn4cts1xga1004 192.168.65.3:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

5. stack deploy:

$ docker stack deploy -c docker-compose.yml teststack
Creating network teststack_webnet
Creating service teststack_web

6.docker-machine创建work节点

$ docker-machine create --driver virtualbox myvm1
Running pre-create checks... (myvm1) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on [::1]:53: read udp [::1]:64196->[::1]:53: read: connection refused Creating machine... (myvm1) Unable to get the latest Boot2Docker ISO release version: Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on [::1]:53: read udp [::1]:58903->[::1]:53: read: connection refused (myvm1) Copying /Users/ningskyer/.docker/machine/cache/boot2docker.iso to /Users/ningskyer/.docker/machine/machines/myvm1/boot2docker.iso... (myvm1) Creating VirtualBox VM... (myvm1) Creating SSH key... (myvm1) Starting the VM... (myvm1) Check network to re-create if needed... (myvm1) Found a new host-only adapter: "vboxnet0" (myvm1) Waiting for an IP... 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 boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env myvm1

 7.国内镜像源:

  • Docker 官方中国区
https://registry.docker-cn.com
  • 网易
http://hub-mirror.c.163.com
  • ustc
https://docker.mirrors.ustc.edu.cn

#daemon.json
{   "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] }

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值