Update docker operator network documentation
See original GitHub issueDescription
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:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Shall I try to fix this documentation? This is quite new for me, but I think I can do it.
I’ve looked through the code of the DockerOperator and from what I can tell, the
network_mode
parameter is passed through to thenetwork_mode
parameter ofAPIClient.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):