Skip to content
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

Merged
merged 4 commits into from Dec 26, 2018
Merged

docker_image: add network parameter #50313

merged 4 commits into from Dec 26, 2018

Conversation

ushuz
Copy link
Contributor

@ushuz ushuz commented Dec 26, 2018

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
  • Feature Pull Request
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.

FiloSottile and others added 3 commits December 26, 2018 15:01
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
@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 cloud community_review In order to be merged, this PR must follow the community review workflow. docker feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Dec 26, 2018
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Dec 26, 2018
Copy link
Contributor

@felixfontein felixfontein left a 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!

@ansibot ansibot added automerge This PR was automatically merged by ansibot. shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Dec 26, 2018
@@ -627,6 +636,7 @@ def main():

option_minimal_versions = dict(
cache_from=dict(docker_py_version='2.1.0', docker_api_version='1.25'),
Copy link
Contributor Author

@ushuz ushuz Dec 26, 2018

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

image

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #50319

@gundalow gundalow merged commit 9be3ebc into ansible:devel Dec 26, 2018
@felixfontein
Copy link
Contributor

@ushuz thanks for the PR!
@gundalow thanks for merging!

@FiloSottile
Copy link

Thanks @ushuz for picking this up!

kbreit pushed a commit to kbreit/ansible that referenced this pull request Jan 11, 2019
* 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
@ushuz ushuz deleted the docker_image-network branch February 6, 2019 15:04
@BasemHamad
Copy link

how does this work?
I'm running ansible 2.8.0a1 and it gives me "Unsupported parameters for (docker_image) module: network"

@felixfontein
Copy link
Contributor

The parameter has been moved into build; see docs for devel (which currently is identical to 2.8 docs, at least for this module ): https://docs.ansible.com/ansible/devel/modules/docker_image_module.html#docker-image-module

@BasemHamad
Copy link

@felixfontein Thanks

@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 automerge This PR was automatically merged by ansibot. cloud docker feature This issue/PR relates to a feature request. module This issue/PR relates to a module. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants