Docker Networking && Data Volume

Source: Internet
Author: User
Tags docker run

  • Overlay Network Overlay Networks

  • Docker Network

  • After the Docker installation is complete, there are three types of network

    Bridge

    Host

    None

    [[email protected] ~] #docker  network lsNETWORK ID           NAME                 DRIVER               scopea636fa65e954        bridge               bridge               localb4c906b718f6        host                 host                 local764d5cb64812         none                 nUll                local 

    Note: If you do not specify a network type when creating a container, the default is bridged network (NAT Bridge)

    Four types of Docker network models

    Closed container

    Do not participate in network communication, processes running in such containers can only access the local loopback interface

    Applies only to scenarios where the process does not require network communication, such as: Backup, Process diagnostics, and various offline tasks

    ~]# Docker run--rm--net none busybox:latest ifconfig-a

    Bridged container

    A bridged network typically has two interfaces: a loopback interface an Ethernet interface connected to a bridge device on the host

    A network bridge named Docker0 is created by default when Docker daemon starts, and the container is created as a bridged container with its Ethernet interface bridged to Docker0

    --net Bridge to add the container interface to the Docker0 bridge

    The Docker0 Bridge is a NAT bridge, so bridge-type containers can access the external network through this bridge interface, but fire rules prevent all requests to access the bridging container from the external network

    ~]# Docker run--rm--net Bridge busybox:latest ifconfig-a

    Joined container

    A federated network is a container that uses a network interface of an existing container, which is shared by each container within the Federation, so that the federated containers are completely isolated from each other, for example:

    Create an HTTP server that listens on port 2222


    Open container

    An open network shared host network namespace container that has full access to the host's network namespace, including access to those critical services, a potential threat to host security



    Setting the network type when creating a container

    Use--network when creating


    Docker Networking && Data Volume

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.