zoukankan      html  css  js  c++  java
  • docker的网络模式

    记性不好,回顾一下。按照惯例,直接看官文。

    Docker’s networking subsystem is pluggable, using drivers. Several drivers exist by default, and provide core networking functionality.
    
    bridge: The default network driver. If you don’t specify a driver, this is the type of network you are creating. Bridge networks are usually used when your applications run in standalone containers that need to communicate. User-defined bridge networks are best when you need multiple containers to communicate on the same Docker host.
    
    host: For standalone containers, remove network isolation between the container and the Docker host, and use the host’s networking directly. host is only available for swarm services on Docker 17.06 and higher. Host networks are best when the network stack should not be isolated from the Docker host, but you want other aspects of the container to be isolated.
    
    overlay: Overlay networks connect multiple Docker daemons together and enable swarm services to communicate with each other. Overlay networks are best when you need containers running on different Docker hosts to communicate, or when multiple applications work together using swarm services.
    
    macvlan: Macvlan networks allow you to assign a MAC address to a container, making it appear as a physical device on your network. The Docker daemon routes traffic to containers by their MAC addresses.
    
    none: For this container, disable all networking. none is not available for swarm services.
    

    docker的网络子系统是插件化的,需要使用驱动。默认支持以下几种驱动:

    • bridge:桥接,默认的网络驱动,如果不指定驱动,将默认使用桥接。通常用在同一个docker主机中的多个容器间通信。
    • host:去掉容器和宿主机之间的网络隔离,直接使用宿主机的网络。通常用在网络不与宿主机隔离但是其他资源需要隔离的场景。
    • overlay:叠加网络,将多个docker daemon连接到一起。主要用在运行在不同宿主机上的容器间通信。
    • macvlan:允许为容器分配一个MAC地址,让它成为一个物理设备。
    • none:禁用网络。swarm不支持。

    参考:
    https://docs.docker.com/network/

  • 相关阅读:
    [读书笔记]-技术学习-微服务架构与实践
    [文章转载]-Java后端,应该日常翻看的中文技术网站 -江南白衣
    [文章转载]-我的Java后端书架-江南白衣
    正则表达式有多强大一看便知!
    微信小程序支付功能完整流程
    判断字符串是否合法(1)
    ES6新增常用方法
    JS求一个字符串在另一个字符串中出现的次数
    根据对象的某个属性排序
    数组去除重复值的四种超简便方法
  • 原文地址:https://www.cnblogs.com/keithtt/p/10229981.html
Copyright © 2011-2022 走看看