亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Compose About versions and upgrading (Compose) ASP.NET Core + SQL Server on Linux (Compose) CLI environment variables (Compose) Command-line completion (Compose) Compose(組成) Compose command-line reference(組合命令行參考) Control startup order (Compose) Django and PostgreSQL (Compose) Docker stacks and distributed application bundles (Compose) docker-compose build(docker-compose構(gòu)建) docker-compose bundle docker-compose config docker-compose create docker-compose down docker-compose events docker-compose exec docker-compose help docker-compose images docker-compose kill docker-compose logs docker-compose pause docker-compose port docker-compose ps docker-compose pull docker-compose push docker-compose restart docker-compose rm docker-compose run docker-compose scale docker-compose start docker-compose stop docker-compose top docker-compose unpause docker-compose up Environment file (Compose) Environment variables in Compose Extend services in Compose Frequently asked questions (Compose) Getting started (Compose) Install Compose Link environment variables (deprecated) (Compose) Networking in Compose Overview of Docker Compose Overview of docker-compose CLI Quickstart: Compose and WordPress Rails and PostgreSQL (Compose) Sample apps with Compose Using Compose in production Using Compose with Swarm Engine .NET Core application (Engine) About images, containers, and storage drivers (Engine) Add nodes to the swarm (Engine) Apply custom metadata (Engine) Apply rolling updates (Engine) apt-cacher-ng Best practices for writing Dockerfiles (Engine) Binaries (Engine) Bind container ports to the host (Engine) Breaking changes (Engine) Build your own bridge (Engine) Configure container DNS (Engine) Configure container DNS in user-defined networks (Engine) CouchDB (Engine) Create a base image (Engine) Create a swarm (Engine) Customize the docker0 bridge (Engine) Debian (Engine) Default bridge network Delete the service (Engine) Deploy a service (Engine) Deploy services to a swarm (Engine) Deprecated Engine features Docker container networking (Engine) Docker overview (Engine) Docker run reference (Engine) Dockerfile reference (Engine) Dockerize an application Drain a node (Engine) Engine FAQ (Engine) Fedora (Engine) Get started (Engine) Get started with macvlan network driver (Engine) Get started with multi-host networking (Engine) How nodes work (Engine) How services work (Engine) Image management (Engine) Inspect the service (Engine) Install Docker (Engine) IPv6 with Docker (Engine) Join nodes to a swarm (Engine) Legacy container links (Engine) Lock your swarm (Engine) Manage nodes in a swarm (Engine) Manage sensitive data with Docker secrets (Engine) Manage swarm security with PKI (Engine) Manage swarm service networks (Engine) Migrate to Engine 1.10 Optional Linux post-installation steps (Engine) Overview (Engine) PostgreSQL (Engine) Raft consensus in swarm mode (Engine) Riak (Engine) Run Docker Engine in swarm mode Scale the service (Engine) SDKs (Engine) Select a storage driver (Engine) Set up for the tutorial (Engine) SSHd (Engine) Storage driver overview (Engine) Store service configuration data (Engine) Swarm administration guide (Engine) Swarm mode key concepts (Engine) Swarm mode overlay network security model (Engine) Swarm mode overview (Engine) Understand container communication (Engine) Use multi-stage builds (Engine) Use swarm mode routing mesh (Engine) Use the AUFS storage driver (Engine) Use the Btrfs storage driver (Engine) Use the Device mapper storage driver (Engine) Use the OverlayFS storage driver (Engine) Use the VFS storage driver (Engine) Use the ZFS storage driver (Engine) Engine: Admin Guide Amazon CloudWatch logs logging driver (Engine) Bind mounts (Engine) Collect Docker metrics with Prometheus (Engine) Configuring and running Docker (Engine) Configuring logging drivers (Engine) Control and configure Docker with systemd (Engine) ETW logging driver (Engine) Fluentd logging driver (Engine) Format command and log output (Engine) Google Cloud logging driver (Engine) Graylog Extended Format (GELF) logging driver (Engine) Journald logging driver (Engine) JSON File logging driver (Engine) Keep containers alive during daemon downtime (Engine) Limit a container's resources (Engine) Link via an ambassador container (Engine) Log tags for logging driver (Engine) Logentries logging driver (Engine) PowerShell DSC usage (Engine) Prune unused Docker objects (Engine) Run multiple services in a container (Engine) Runtime metrics (Engine) Splunk logging driver (Engine) Start containers automatically (Engine) Storage overview (Engine) Syslog logging driver (Engine) tmpfs mounts Troubleshoot volume problems (Engine) Use a logging driver plugin (Engine) Using Ansible (Engine) Using Chef (Engine) Using Puppet (Engine) View a container's logs (Engine) Volumes (Engine) Engine: CLI Daemon CLI reference (dockerd) (Engine) docker docker attach docker build docker checkpoint docker checkpoint create docker checkpoint ls docker checkpoint rm docker commit docker config docker config create docker config inspect docker config ls docker config rm docker container docker container attach docker container commit docker container cp docker container create docker container diff docker container exec docker container export docker container inspect docker container kill docker container logs docker container ls docker container pause docker container port docker container prune docker container rename docker container restart docker container rm docker container run docker container start docker container stats docker container stop docker container top docker container unpause docker container update docker container wait docker cp docker create docker deploy docker diff docker events docker exec docker export docker history docker image docker image build docker image history docker image import docker image inspect docker image load docker image ls docker image prune docker image pull docker image push docker image rm docker image save docker image tag docker images docker import docker info docker inspect docker kill docker load docker login docker logout docker logs docker network docker network connect docker network create docker network disconnect docker network inspect docker network ls docker network prune docker network rm docker node docker node demote docker node inspect docker node ls docker node promote docker node ps docker node rm docker node update docker pause docker plugin docker plugin create docker plugin disable docker plugin enable docker plugin inspect docker plugin install docker plugin ls docker plugin push docker plugin rm docker plugin set docker plugin upgrade docker port docker ps docker pull docker push docker rename docker restart docker rm docker rmi docker run docker save docker search docker secret docker secret create docker secret inspect docker secret ls docker secret rm docker service docker service create docker service inspect docker service logs docker service ls docker service ps docker service rm docker service scale docker service update docker stack docker stack deploy docker stack ls docker stack ps docker stack rm docker stack services docker start docker stats docker stop docker swarm docker swarm ca docker swarm init docker swarm join docker swarm join-token docker swarm leave docker swarm unlock docker swarm unlock-key docker swarm update docker system docker system df docker system events docker system info docker system prune docker tag docker top docker unpause docker update docker version docker volume docker volume create docker volume inspect docker volume ls docker volume prune docker volume rm docker wait Use the Docker command line (Engine) Engine: Extend Access authorization plugin (Engine) Docker log driver plugins Docker network driver plugins (Engine) Extending Engine with plugins Managed plugin system (Engine) Plugin configuration (Engine) Plugins API (Engine) Volume plugins (Engine) Engine: Security AppArmor security profiles for Docker (Engine) Automation with content trust (Engine) Content trust in Docker (Engine) Delegations for content trust (Engine) Deploying Notary (Engine) Docker security (Engine) Docker security non-events (Engine) Isolate containers with a user namespace (Engine) Manage keys for content trust (Engine) Play in a content trust sandbox (Engine) Protect the Docker daemon socket (Engine) Seccomp security profiles for Docker (Engine) Secure Engine Use trusted images Using certificates for repository client verification (Engine) Engine: Tutorials Engine tutorials Network containers (Engine) Get Started Part 1: Orientation Part 2: Containers Part 3: Services Part 4: Swarms Part 5: Stacks Part 6: Deploy your app Machine Amazon Web Services (Machine) Digital Ocean (Machine) docker-machine active docker-machine config docker-machine create docker-machine env docker-machine help docker-machine inspect docker-machine ip docker-machine kill docker-machine ls docker-machine provision docker-machine regenerate-certs docker-machine restart docker-machine rm docker-machine scp docker-machine ssh docker-machine start docker-machine status docker-machine stop docker-machine upgrade docker-machine url Driver options and operating system defaults (Machine) Drivers overview (Machine) Exoscale (Machine) Generic (Machine) Get started with a local VM (Machine) Google Compute Engine (Machine) IBM Softlayer (Machine) Install Machine Machine Machine CLI overview Machine command-line completion Machine concepts and help Machine overview Microsoft Azure (Machine) Microsoft Hyper-V (Machine) Migrate from Boot2Docker to Machine OpenStack (Machine) Oracle VirtualBox (Machine) Provision AWS EC2 instances (Machine) Provision Digital Ocean Droplets (Machine) Provision hosts in the cloud (Machine) Rackspace (Machine) VMware Fusion (Machine) VMware vCloud Air (Machine) VMware vSphere (Machine) Notary Client configuration (Notary) Common Server and signer configurations (Notary) Getting started with Notary Notary changelog Notary configuration files Running a Notary service Server configuration (Notary) Signer configuration (Notary) Understand the service architecture (Notary) Use the Notary client
characters

本文使用一個(gè)示例來解釋創(chuàng)建多主機(jī)網(wǎng)絡(luò)的基礎(chǔ)知識(shí)。Docker 通過overlay網(wǎng)絡(luò)驅(qū)動(dòng)程序支持多主機(jī)網(wǎng)絡(luò)。與bridge網(wǎng)絡(luò)不同,覆蓋網(wǎng)絡(luò)需要一些預(yù)先存在的條件才能創(chuàng)建一個(gè):

  • Docker以群集模式運(yùn)行

  • 使用密鑰值存儲(chǔ)的主機(jī)群集

覆蓋網(wǎng)絡(luò)和群集模式

使用以群模式運(yùn)行的 Docker,您可以在管理器節(jié)點(diǎn)上創(chuàng)建覆蓋網(wǎng)絡(luò)。

群體使覆蓋網(wǎng)絡(luò)只能用于群體中需要服務(wù)的節(jié)點(diǎn)。當(dāng)您創(chuàng)建使用覆蓋網(wǎng)絡(luò)的服務(wù)時(shí),管理器節(jié)點(diǎn)會(huì)自動(dòng)將覆蓋網(wǎng)絡(luò)擴(kuò)展到運(yùn)行服務(wù)任務(wù)的節(jié)點(diǎn)。

要了解有關(guān)在群集模式下運(yùn)行 Docker 的更多信息,請(qǐng)參閱群集模式概述。

下面的例子顯示了如何創(chuàng)建一個(gè)網(wǎng)絡(luò)并將其用于群中管理器節(jié)點(diǎn)的服務(wù):

# Create an overlay network `my-multi-host-network`.$ docker network create \  --driver overlay \  --subnet 10.0.9.0/24 \
  my-multi-host-network

400g6bwzd68jizzdx5pgyoe95

# Create an nginx service and extend the my-multi-host-network to nodes where
# the service's tasks run.$ docker service create --replicas 2 --network my-multi-host-network --name my-web nginx

716thylsndqma81j6kkkb5aus

群集的覆蓋網(wǎng)絡(luò)不適用于非托管容器。有關(guān)更多信息,請(qǐng)參閱 Docker 群集模式覆蓋網(wǎng)絡(luò)安全模型。

另請(qǐng)參閱將服務(wù)附加到覆蓋網(wǎng)絡(luò)。

使用外部鍵值存儲(chǔ)覆蓋網(wǎng)絡(luò)

要將 Docker 引擎與外部鍵值存儲(chǔ)一起使用,您需要以下內(nèi)容:

  • 訪問鍵值存儲(chǔ)。Docker 支持 Consul,Etcd 和 ZooKeeper(分布式存儲(chǔ))鍵值存儲(chǔ)。

  • 連接到鍵值存儲(chǔ)的主機(jī)集群。

  • daemon集群中每臺(tái)主機(jī)上配置正確的引擎。

  • 集群中的主機(jī)必須具有唯一主機(jī)名,因?yàn)殒I值存儲(chǔ)使用主機(jī)名來標(biāo)識(shí)集群成員。

雖然 Docker Machine 和 Docker Swarm 不是強(qiáng)制性體驗(yàn) Docker 多主機(jī)網(wǎng)絡(luò)的關(guān)鍵值存儲(chǔ),但此示例使用它們來說明它們是如何集成的。您將使用 Machine 來創(chuàng)建鍵值存儲(chǔ)服務(wù)器和主機(jī)群集。這個(gè)例子創(chuàng)建了一個(gè)swarm 集群。

注意:以群集模式運(yùn)行的 Docker Engine 與外部鍵值存儲(chǔ)的網(wǎng)絡(luò)不兼容。

先決條件

在開始之前,請(qǐng)確保您的網(wǎng)絡(luò)上安裝了最新版本的 Docker Engine 和 Docker Machine。這個(gè)例子也依賴于VirtualBox。如果您使用 Docker Toolbox 安裝在 Mac 或 Windows上,則已經(jīng)安裝了所有這些設(shè)備。

如果您尚未這樣做,請(qǐng)確保將 Docker Engine 和 Docker Machine 升級(jí)到最新版本。

設(shè)置一個(gè)鍵值存儲(chǔ)

覆蓋網(wǎng)絡(luò)需要鍵值存儲(chǔ)。鍵值存儲(chǔ)保存有關(guān)網(wǎng)絡(luò)狀態(tài)的信息,其中包括發(fā)現(xiàn),網(wǎng)絡(luò),端點(diǎn),IP 地址等。Docker 支持 Consul,Etcd 和 ZooKeeper鍵值存儲(chǔ)。這個(gè)例子使用 Consul。

  1. 登錄到使用先決條件 Docker Engine,Docker Machine 和 VirtualBox軟件準(zhǔn)備的系統(tǒng)。

  1. 配置名為的 VirtualBox 機(jī)器mh-keystore。

$ docker-machine create -d virtualbox mh-keystore

當(dāng)您供應(yīng)新機(jī)器時(shí),該流程會(huì)將 Docker Engine 添加到主機(jī)。這意味著不是手動(dòng)安裝 Consul,而是使用Docker Hub 的 consul鏡像創(chuàng)建一個(gè)實(shí)例。你會(huì)在下一步做到這一點(diǎn)。

  1. 將您的本地環(huán)境設(shè)置為mh-keystore機(jī)器。$ eval“$(docker-machine env mh-keystore)”

  1. 啟動(dòng)progrium/consulmh-keystore機(jī)器上運(yùn)行的容器。

$ docker run -d \ -p“8500:8500”\ -h“consul”\ progrium / consul -server -bootstrap

客戶端啟動(dòng)progrium/consulmh-keystore機(jī)器中運(yùn)行的映像。服務(wù)器被調(diào)用consul并正在偵聽端口8500

  1. Run the docker ps command to see the consul container. $ docker ps   CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                                            NAMES  4d51392253b3        progrium/consul     "/bin/start -server -"   25 minutes ago      Up 25 minutes       53/tcp, 53/udp, 8300-8302/tcp, 0.0.0.0:8500->8500/tcp, 8400/tcp, 8301-8302/udp   admiring_panini Keep your terminal open and move onto the next step.Create a swarm clusterIn this step, you use docker-machine為您的網(wǎng)絡(luò)配置主機(jī)。此時(shí),您不會(huì)真正創(chuàng)建網(wǎng)絡(luò)。您將在VirtualBox中創(chuàng)建多臺(tái)機(jī)器。其中一臺(tái)機(jī)器將作為swarm master; 你會(huì)先創(chuàng)建它。在創(chuàng)建每臺(tái)主機(jī)時(shí),您需要在overlay網(wǎng)絡(luò)驅(qū)動(dòng)程序所需的機(jī)器上傳遞引擎。

  1. 創(chuàng)建一個(gè)swarm主。

$ docker-machine create \ -d virtualbox \ --swarm --swarm-master \ --swarm-discovery =“consul:// $(docker-machine ip mh -keystore):8500”\ --engine-opt = “cluster-store = consul:// $(docker-machine ip mh -keystore):8500”\ --engine-opt =“cluster-advertise = eth1:2376”\ mhs-demo0

在創(chuàng)建時(shí),您可以為引擎daemon提供--cluster-store選項(xiàng)。該選項(xiàng)告訴引擎overlay網(wǎng)絡(luò)的鍵值存儲(chǔ)位置。bash擴(kuò)展$(docker-machine ip mh-keystore)解析為您在“步驟1”中創(chuàng)建的Consul服務(wù)器的IP地址。該--cluster-advertise選項(xiàng)通告網(wǎng)絡(luò)上的機(jī)器。

  1. 創(chuàng)建另一個(gè)主機(jī)并將其添加到群集。$ docker-machine create -d virtualbox \ --swarm \ --swarm-discovery =“consul:// $(docker-machine ip mh -keystore):8500”\ --engine-opt =“cluster-store = consul :// $(docker-machine ip mh-keystore):8500“\ --engine-opt =”cluster-advertise = eth1:2376“\ mhs-demo1

  1. 列出您的機(jī)器以確認(rèn)它們?nèi)空_\(yùn)行。

$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM default  -  virtualbox運(yùn)行tcp://192.168.99.100:2376 mh -keystore * virtualbox運(yùn)行tcp://192.168.99.103:2376 mhs-demo0  -  virtualbox運(yùn)行tcp://192.168 .99.104:2376 mhs-demo0(主)mhs-demo1  -  virtualbox運(yùn)行tcp://192.168.99.105:2376 mhs-demo0

此時(shí),您的網(wǎng)絡(luò)上正在運(yùn)行一組主機(jī)。您已準(zhǔn)備好使用這些主機(jī)為容器創(chuàng)建多主機(jī)網(wǎng)絡(luò)。

將您的終端打開并繼續(xù)下一步。

創(chuàng)建覆蓋網(wǎng)絡(luò)

創(chuàng)建覆蓋網(wǎng)絡(luò)

  1. 將 docker 環(huán)境設(shè)置為 swarm master。$ eval $(docker-machine env --swarm mhs-demo0)使用該--swarm標(biāo)志docker-machine限制了docker單獨(dú)集群信息的命令。

  1. 使用該docker info命令查看群。

$ docker info容器:3圖像:2角色:主要策略:傳播過濾器:親和力,健康,約束,端口,依賴關(guān)系節(jié)點(diǎn):2 mhs-demo0:192.168.99.104:2376└容器:2└保留的CPU:0/1└保留內(nèi)存:0 B / 1.021 GiB└標(biāo)簽:executiondriver = native-0.2,kernelversion = 4.1.10-boot2docker,operatingsystem = Boot2Docker 1.9.0(TCL 6.4); master:4187d2c  -  Wed Oct 14 14:00:28 UTC 2015,provider = virtualbox,storagedriver = aufs mhs-demo1:192.168.99.105:2376└Containers:1└Reserved CPUs:0/1└Reserved Memory:0 B / 1.021 GiB└標(biāo)簽:executiondriver = native-0.2,kernelversion = 4.1.10-boot2docker,operatingsystem = Boot2Docker 1.9.0(TCL 6.4); master:4187d2c  -  Wed Oct 14 14:00:28 UTC 2015,provider = virtualbox,storagedriver = aufs CPUs:2總內(nèi)存:2.043 GiB名稱:30438ece0915

根據(jù)這些信息,您可以看到您正在 Master 上運(yùn)行三個(gè)容器和兩個(gè)圖像。

  1. 創(chuàng)建您的overlay網(wǎng)絡(luò)。$ docker network create --driver overlay --subnet = 10.0.9.0 / 24 my-net您只需要在集群中的單個(gè)主機(jī)上創(chuàng)建網(wǎng)絡(luò)。在這種情況下,您使用了swarm master,但您可以輕松地在集群中的任何主機(jī)上運(yùn)行它。  注意:強(qiáng)烈建議--subnet在創(chuàng)建網(wǎng)絡(luò)時(shí)使用該選項(xiàng)。如果--subnet未指定,則docker守護(hù)進(jìn)程會(huì)自動(dòng)選擇并為網(wǎng)絡(luò)分配一個(gè)子網(wǎng),并且可能會(huì)與您的基礎(chǔ)架構(gòu)中未由 docker 管理的另一個(gè)子網(wǎng)重疊。當(dāng)容器連接到該網(wǎng)絡(luò)時(shí),這種重疊會(huì)導(dǎo)致連接問題或失敗。

  1. 檢查網(wǎng)絡(luò)是否正在運(yùn)行:

$泊塢窗網(wǎng)LS網(wǎng)絡(luò)ID名稱驅(qū)動(dòng)程序412c2496d0eb MHS-demo1的/主機(jī)主機(jī)dd51763e6dd2 MHS-demo0 /橋橋6b07d0be843f b4234109bd9b MHS-demo0 /無空1aeead6dd890 MHS-demo0 /主機(jī)主機(jī)我的網(wǎng)覆蓋d0bb78cbe7bd MHS-demo1的/橋橋1c0eb8f69ebb MHS -demo1 / null的無

當(dāng)您處于 swarm master 環(huán)境中時(shí),您會(huì)看到所有 swarm agent 上的所有網(wǎng)絡(luò):每個(gè)引擎上的默認(rèn)網(wǎng)絡(luò)和單個(gè)覆蓋網(wǎng)絡(luò)。注意每個(gè)NETWORK ID都是唯一的。

  1. Switch to each swarm agent in turn and list the networks. $ eval $(docker-machine env mhs-demo0)  $ docker network ls  NETWORK ID          NAME                DRIVER 6b07d0be843f        my-net              overlay dd51763e6dd2        bridge              bridge b4234109bd9b        none                null 1aeead6dd890        host                host  $ eval $(docker-machine env mhs-demo1)  $ docker network ls  NETWORK ID          NAME                DRIVER d0bb78cbe7bd        bridge              bridge 1c0eb8f69ebb        none                null 412c2496d0eb        host                host 6b07d0be843f        my-net              overlay Both agents report they have the my-net network with the 6b07d0be843fID。您現(xiàn)在正在運(yùn)行多主機(jī)容器網(wǎng)絡(luò)!在網(wǎng)絡(luò)上運(yùn)行應(yīng)用程序一旦創(chuàng)建了網(wǎng)絡(luò),您就可以在任何主機(jī)上啟動(dòng)容器,并且它自動(dòng)成為網(wǎng)絡(luò)的一部分。

  1. 將你的環(huán)境指向 swarm master。

$ eval $(docker-machine env --swarm mhs-demo0)

  1. mhs-demo0實(shí)例上啟動(dòng)一個(gè)Nginx Web服務(wù)器。$ docker run -itd --name = web --network = my-net --env =“constraint:node == mhs-demo0”nginx

  1. 在實(shí)例上運(yùn)行 BusyBox 實(shí)例mhs-demo1并獲取Nginx服務(wù)器主頁(yè)的內(nèi)容。

$ docker run -it --rm --network=my-net --env="constraint:node==mhs-demo1" busybox wget -O- http://web  Unable to find image 'busybox:latest' locally latest: Pulling from library/busybox ab2b8a86ca6c: Pull complete 2c5ac3f849df: Pull complete Digest: sha256:5551dbdfc48d66734d0f01cafee0952cb6e8eeecd1e2492240bf2fd9640c2279 Status: Downloaded newer image for busybox:latest Connecting to web (10.0.0.2:80) <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body {         width: 35em;         margin: 0 auto;         font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p>  <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p>  <p><em>Thank you for using nginx.</em></p> </body> </html> -                    100% |*******************************|   612   0:00:00 ETA

檢查外部連接

如您所見,Docker 的內(nèi)置覆蓋網(wǎng)絡(luò)驅(qū)動(dòng)程序可在同一網(wǎng)絡(luò)中多個(gè)主機(jī)上的容器之間提供開箱即用的連接。另外,連接到多主機(jī)網(wǎng)絡(luò)的容器會(huì)自動(dòng)連接到docker_gwbridge網(wǎng)絡(luò)。該網(wǎng)絡(luò)允許容器在群集外部具有外部連接。

  1. 將您的環(huán)境更改為swarm agent。$ eval $(docker-machine env mhs-demo1)

  1. docker_gwbridge通過列出網(wǎng)絡(luò)來查看網(wǎng)絡(luò)。

$ LS泊塢窗網(wǎng)絡(luò)ID網(wǎng)絡(luò)名稱驅(qū)動(dòng)程序6b07d0be843f我網(wǎng)覆蓋dd51763e6dd2橋橋b4234109bd9b返回null 1aeead6dd890主機(jī)主橋e1dbd5dff8be docker_gwbridge

  1. 重復(fù)swarm master上的步驟1和2。$ eval $(docker-machine env mhs-demo0)$ docker network ls NETWORK ID NAME DRIVER 6b07d0be843f my-net overlay d0bb78cbe7bd bridge bridge 1c0eb8f69ebb none null 412c2496d0eb host host 97102a22e8d2 docker_gwbridge bridge

  1. 檢查Nginx容器的網(wǎng)絡(luò)接口。

00:00:00:00:00 brd 00:00:00:00:00:$ docker exec web ip addr 1:lo:<LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group默認(rèn)鏈接/ 00 inet 127.0.0.1/8作用域主機(jī)lo valid_lft永遠(yuǎn)preferred_lft永遠(yuǎn)inet6 :: 1/128作用域主機(jī)valid_lft永遠(yuǎn)preferred_lft永遠(yuǎn)22:eth0:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue狀態(tài)UP組默認(rèn)鏈接/ ether 02:42:0a:00:09:03 brd ff:ff:ff:ff:ff:inet 10.0.9.3/24 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80 :: 42:aff:fe00:903/64 scope永久鏈接valid_lft preferred_lft forever 24:eth1:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link / ether 02:42:ac:12:00:02 brd ff:ff:ff:ff:ff :ff inet 172.18.0。2/16范圍全局eth1 valid_lft永遠(yuǎn)preferred_lft永遠(yuǎn)inet6 fe80 :: 42:acff:fe12:2/64范圍鏈接valid_lft forever永遠(yuǎn)preferred_lft永遠(yuǎn)

eth0接口表示連接到my-net覆蓋網(wǎng)絡(luò)的容器接口。雖然eth1接口代表連接到所述容器的接口docker_gwbridge網(wǎng)絡(luò)。

使用Docker撰寫額外功勞

請(qǐng)參閱 Compose V2 格式中介紹的網(wǎng)絡(luò)功能,并在上述群集中執(zhí)行多主機(jī)網(wǎng)絡(luò)場(chǎng)景。

相關(guān)信息

  • 了解 Docker 容器網(wǎng)絡(luò)

  • 使用網(wǎng)絡(luò)命令

  • Docker群集概述

  • Docker機(jī)器概述

Previous article: Next article: