New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker_image: add network parameter #50313
Conversation
Add a network parameter to the docker_image module to specify the network to use for RUN commands. Called it network instead of network_mode as the latter seems like a legacy of when there were just a few default options to choose from, while now the name of an arbitrary network can be specified. Fixes #21433
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for reviving this!
@@ -627,6 +636,7 @@ def main(): | |||
|
|||
option_minimal_versions = dict( | |||
cache_from=dict(docker_py_version='2.1.0', docker_api_version='1.25'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixfontein it would be great if docs can include these version requirements somehow, currently there's none
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Currently, the only way to do that would be to add that information manually, which is somewhat annoying and error-prone. Could you create a Feature Request issue for this (for the docker modules)? Then we can collect ideas how we can improve this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #50319
Thanks @ushuz for picking this up! |
* docker_image: add network parameter Add a network parameter to the docker_image module to specify the network to use for RUN commands. Called it network instead of network_mode as the latter seems like a legacy of when there were just a few default options to choose from, while now the name of an arbitrary network can be specified. Fixes ansible#21433 * Format description * Update docker_image option_minimal_versions * Ensure network_mode param optional
how does this work? |
The parameter has been moved into |
@felixfontein Thanks |
SUMMARY
Add a network parameter to the docker_image module to specify the network to use for RUN commands.
#45127 seems to be abandoned, so I picked it up. I cherrypicked @FiloSottile's commit to keep the credit.
Fixes #45127, #21433
ISSUE TYPE
COMPONENT NAME
docker_image
ADDITIONAL INFORMATION
Called it network instead of network_mode as the latter seems like a
legacy of when there were just a few default options to choose from,
while now the name of an arbitrary network can be specified.