question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update docker operator network documentation

See original GitHub issue

Description

The current parameter for selecting the network in the DockerOperator is network_mode. There is not a clear explanation of the scope of this field in the docs.

Use case / motivation

I was trying to develop a dag that needed access to a predefined docker network in the Host. I found in the documentation the network_mode parameter for the docker operator. The description of the parameter is the following:

network_mode (str) – Network mode for the container.

By this description, I supposed that the available parameters for the network_mode were just the default drivers (bridge, host, overlay). However, when testing it, I found out that you can indeed specify a user-defined network for the DockerOperator.

I think that the current documentation is not clear enough about this functionality (or maybe the parameter name is not very descriptive). It would be very useful to have more detailed docs in this section of the documentation.

Thanks in advance!

Related Issues

None.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Bowrnacommented, Mar 1, 2022

Shall I try to fix this documentation? This is quite new for me, but I think I can do it.

1reaction
mbarkhaucommented, Jan 25, 2021

I’ve looked through the code of the DockerOperator and from what I can tell, the network_mode parameter is passed through to the network_mode parameter of APIClient.create_host_config method:

From the source code at docker/api/container.py(https://github.com/docker/docker-py/blob/master/docker/api/container.py#L443):

    def create_host_config(self, *args, **kwargs):
            """
            ...

            network_mode (str): One of:
                - ``bridge`` Create a new network stack for the container on
                  the bridge network.
                - ``none`` No networking for this container.
                - ``container:<name|id>`` Reuse another container's network
                  stack.
                - ``host`` Use the host network stack.
                  This mode is incompatible with ``port_bindings``.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Networking overview - Docker Documentation
Overview of Docker networks and networking concepts.
Read more >
airflow.providers.docker.operators.docker
This is to make it works by default with remote docker engine or when you run docker-in-docker solution and temporary directory is not...
Read more >
Docker driver - Nomad - HashiCorp Developer
The Docker task driver is used to run Docker based tasks. ... group network as trusted and can be resolved as described in...
Read more >
GitLab Docker images
yml file. However, reuse the CE container name, port and file mappings, and version. Upgrade the product documentation. This is an optional step ......
Read more >
Network Operator - NVIDIA Networking Docs
NicClusterPolicy update is not supported at the moment. Network Operator is compatible only with NVIDIA GPU Operator v1.9.0 and above. GPUDirect could have ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found