Skip to content

Commit 433264d

Browse files
author
Daeseok Youn
committed
Correct comments on ports_binding and host mode as network_mode
Signed-off-by: Daeseok Youn <[email protected]>
1 parent 9c53024 commit 433264d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

docker/api/container.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ def create_host_config(self, *args, **kwargs):
524524
stack.
525525
- ``host`` Use the host network stack.
526526
This mode is incompatible with ``port_bindings``.
527-
If ``host`` is used as network_mode, all of listed up to
528-
``port_bindings``` are ignored in running container.
529527
530528
oom_kill_disable (bool): Whether to disable OOM killer.
531529
oom_score_adj (int): An integer value containing the score given
@@ -535,8 +533,8 @@ def create_host_config(self, *args, **kwargs):
535533
pids_limit (int): Tune a container's pids limit. Set ``-1`` for
536534
unlimited.
537535
port_bindings (dict): See :py:meth:`create_container`
538-
for more information. The binding ports are ignored in
539-
``host`` as network mode.
536+
for more information.
537+
Imcompatible with ``host`` in ``network_mode``.
540538
privileged (bool): Give extended privileges to this container.
541539
publish_all_ports (bool): Publish all ports to the host.
542540
read_only (bool): Mount the container's root filesystem as read

docker/models/containers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,7 @@ def run(self, image, command=None, stdout=True, stderr=False,
649649
- ``container:<name|id>`` Reuse another container's network
650650
stack.
651651
- ``host`` Use the host network stack.
652-
This mode is incompatible with ``ports``. If ``host`` is
653-
used as network_mode, all of listed up to ``ports``` are
654-
ignored in running container.
652+
This mode is incompatible with ``ports``.
655653
656654
Incompatible with ``network``.
657655
oom_kill_disable (bool): Whether to disable OOM killer.
@@ -670,8 +668,6 @@ def run(self, image, command=None, stdout=True, stderr=False,
670668
``port/protocol``, where the protocol is either ``tcp``,
671669
``udp``, or ``sctp``.
672670
673-
Ports are ignored to bind with ``host`` as network mode.
674-
675671
The values of the dictionary are the corresponding ports to
676672
open on the host, which can be either:
677673
@@ -687,6 +683,7 @@ def run(self, image, command=None, stdout=True, stderr=False,
687683
to a single container port. For example,
688684
``{'1111/tcp': [1234, 4567]}``.
689685
686+
Imcompatible with ``host`` in ``network_mode``.
690687
privileged (bool): Give extended privileges to this container.
691688
publish_all_ports (bool): Publish all ports to the host.
692689
read_only (bool): Mount the container's root filesystem as read

0 commit comments

Comments
 (0)