上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 安装配置 flannel 1) build flannel flannel 没有现成的执行文件可用,必须自己 build,最可靠的方法是在 Docker 容器中 build。 不过用于做 build 的 docker 镜像托管在 gcr.io,国内可能无法直接访问,所以使用参考文档中提供的镜像,构建 阅读全文
posted @ 2019-03-28 18:40 gsophy 阅读(180) 评论(0) 推荐(0) 编辑
摘要: flannel 概述 flannel 是 CoreOS 开发的容器网络解决方案。 flannel 为每个 host 分配一个 subnet,容器从此 subnet 中分配 IP,这些 IP 可以在 host 间路由,容器间无需 NAT 和 port mapping 就可以跨主机通信。 每个 subn 阅读全文
posted @ 2019-03-28 16:09 gsophy 阅读(243) 评论(0) 推荐(0) 编辑
摘要: macvlan 网络隔离和连通 验证 macvlan 之间的连通性。 bbox1 能 ping 通 bbox3,bbox2 能 ping 通 bbox4。 即:同一 macvlan 网络能通信。 bbox1 无法 ping 通 bbox2 和 bbox4。 即:不同 macvlan 网络之间不能通信 阅读全文
posted @ 2019-03-26 16:23 gsophy 阅读(240) 评论(0) 推荐(0) 编辑
摘要: macvlan 网络结构分析 macvlan 不依赖 Linux bridge,brctl show 可以确认没有创建新的 bridge。 查看一下容器 bbox1 的网络设备: 除了 lo,容器只有一个 eth0,请注意 eth0 后面的 @if2,这表明该 interface 有一个对应的 in 阅读全文
posted @ 2019-03-25 11:31 gsophy 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1、创建 macvlan 网络 在 host1 和 host2 中创建 macvlan 网络 mac_net1: docker network create -d macvlan --subnet=172.16.86.0/24 --gateway=172.16.86.1 -o parent=ens1 阅读全文
posted @ 2019-03-22 15:37 gsophy 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 准备 macvlan 环境 macvlan 本身是 linux kernel 模块,其功能是允许在同一个物理网卡上配置多个 MAC 地址,即多个 interface,每个 interface 可以配置自己的 IP。 macvlan 本质上是一种网卡虚拟化技术,Docker 用 macvlan 实现容 阅读全文
posted @ 2019-03-21 09:53 gsophy 阅读(117) 评论(0) 推荐(0) 编辑
摘要: overlay 是如何隔离的? 不同的 overlay 网络是相互隔离的。 创建第二个 overlay 网络 ov_net2 并运行容器 bbox3。 docker network create -d overlay ov_net2 docker run -itd --name bbox3 --ne 阅读全文
posted @ 2019-03-20 09:50 gsophy 阅读(204) 评论(0) 推荐(0) 编辑
摘要: overlay 如何实现跨主机通信? 在 host2 中运行容器 bbox2: docker run -itd --name bbox2 --network ov_net1 busybox bbox2 IP 为 10.0.0.4,可以直接 ping bbox1: 可见 overlay 网络中的容器可 阅读全文
posted @ 2019-03-19 10:57 gsophy 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 在 overlay 中运行容器 运行一个 busybox 容器并连接到 ov_net1: docker run -itd --name bbox1 --network ov_net1 busybox 查看容器的网络配置: bbox1 有两个网络接口 eth0 和 eth1。 eth0 IP 为 10 阅读全文
posted @ 2019-03-18 19:12 gsophy 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 在 host1 中创建 overlay 网络 ov_net1: docker network create -d overlay ov_net1 -d overlay 指定 driver 为 overaly docker network ls 查看当前网络: 注意到 ov_net1 的 SCOPE 阅读全文
posted @ 2019-03-15 20:58 gsophy 阅读(171) 评论(0) 推荐(0) 编辑
摘要: overlay环境准备 在docker-machine (10.12.31.21)的基础上 docker主机 host1 (10.12.31.22) host2 (10.12.31.23) 在docker-machine (10.12.31.21)上部署安装模块Consul docker run - 阅读全文
posted @ 2019-03-14 10:19 gsophy 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 跨主机网络概述 Docker 的几种网络方案:none、host、bridge 和 joined 容器,它们解决了单个 Docker Host 内容器通信的问题 跨主机网络方案包括: docker 原生:overlay 和 macvlan 第三方方案: flannel、weave 和 calico 阅读全文
posted @ 2019-03-13 09:50 gsophy 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 管理 Machine Docker Machine 则很简单 docker-machine env host1 显示访问 host1 需要的所有环境变量: 根据提示,执行 eval $(docker-machine env host1): 命令行提示符已经变了,是因为在$HOME/.bashrc 中 阅读全文
posted @ 2019-03-12 10:01 gsophy 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 创建 Machine Machine 就是运行 docker daemon 的主机。 “创建 Machine” 指的就是在 host 上安装和部署 docker。 创建第一个 machine: host1 创建 machine 要求能够无密码登录远程主机 (1)配置无密码登录、确保端口2376是可以 阅读全文
posted @ 2019-03-11 15:48 gsophy 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 安装 Docker Machine 先安装docker 官方安装docker-machine的文档地址:https://docs.docker.com/machine/install-machine/ 安装方法很简单,执行如下命令: curl -L https://github.com/docker 阅读全文
posted @ 2019-03-08 09:31 gsophy 阅读(204) 评论(0) 推荐(0) 编辑
摘要: volume 生命周期管理 1)备份 因为 volume 实际上是 host 文件系统中的目录和文件,所以 volume 的备份实际上是对文件系统的备份 例如:本地的Registry,所有镜像都存在/myregistry 目录中,定期备份这个目录即可。 2)恢复 Volume 的恢复也简单,就是将备 阅读全文
posted @ 2019-03-06 09:28 gsophy 阅读(216) 评论(0) 推荐(0) 编辑
摘要: data-packed volume container 将数据打包到镜像中,然后通过 docker managed volume 共享 1、先用Dockerfile 构建镜像 ADD 将静态文件添加到容器目录 /usr/local/apache2/htdocs VOLUME 的作用与 -v 等效, 阅读全文
posted @ 2019-03-06 09:24 gsophy 阅读(172) 评论(0) 推荐(0) 编辑
摘要: volume container volume container 是专门为其他容器提供 volume 的容器。它提供的卷可以是 bind mount,也可以是 docker managed volume。 创建 volume container: 容器名为 vc_data(vc 是 volume 阅读全文
posted @ 2019-03-04 09:51 gsophy 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 1、容器与 host 共享数据 两种类型的 data volume,都可以实现在容器与 host 之间共享数据 1、bind mount : 直接将要共享的目录 mount 到容器 2、docker managed volume : 由于 volume 位于 host 中的目录,是在容器启动时才生成 阅读全文
posted @ 2019-03-04 09:47 gsophy 阅读(250) 评论(0) 推荐(0) 编辑
摘要: docker managed volume 与 bind mount 在最大区别是不需要指定 mount 源,指明 mount point 就行了 通过 -v 告诉 docker 需要一个 data volume docker inspect 的输出中 Mounts 的部分,显示容器当前使用的所有 阅读全文
posted @ 2019-03-01 13:32 gsophy 阅读(238) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页