"Linux" "Services" "Docker" network

Source: Internet
Author: User

Network model of the container:

Closed container:
There is only one interface: Loopback
Not participate in network communication, only for applications without network communication, such as backup, program debugging, etc.
--net None

Bridged container:
There are two interfaces for this type of container:
Loopback
Ethernet interface: Bridge to Docker daemon settings used by the bridge, the default is Docker0;

--net Bridge
-H,--hostname hostname
--dns dns_server_ip
--add-host "Hostname:ip"

Docker0 the container on the Nat bridge model is published to external network access:
-P <containerPort>
Only the container port is given, indicating that the specified container port is mapped to a random port on the host;

-P Mapping the
-P Map a random port on the host's
-P Map Port
-P,--publish-all
Publish all the ports, along with the--expose option to indicate the external ports to expose;

If you do not want to start the container by using the default Docker0 bridge interface, you need to run the Docker Daemon command using the
-B Option: Specify the bridge to use;

Federated Containers:

When starting a container, let it use the network namespace of an already existing container;

--net Container:container_name

Open containers:

The container uses the host's network name space;

--net Host

Dependencies between containers:
Link mechanism: Linking
--link

Resource Limits for containers:
Options for the Run command:
-M
--cpuset-cpus
--shm-size

"Linux" "Services" "Docker" network

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.