operations.docker: add extra parameters#1593
Merged
DonDebonair merged 3 commits intopyinfra-dev:3.xfrom Apr 19, 2026
Merged
Conversation
… cpus, memory and extra_args to container
Fizzadar
approved these changes
Mar 12, 2026
Member
|
Augh another PR also touched this op; there's some conflicts here @wowi42 (I don't have permission to fix) |
Resolves conflicts in src/pyinfra/operations/docker.py and src/pyinfra/operations/util/docker.py: this branch adds the ``mounts``, ``privileged``, ``hostname``, ``entrypoint``, ``user``, ``cpus``, ``memory`` and ``extra_args`` parameters to ``docker.container`` while 3.x independently added ``dns``. Both sets of fields are kept and exposed: - ``ContainerSpec`` grows both groups of fields (in addition to the existing ones) and ``container_create_args`` emits all the corresponding ``docker container create`` flags, with the ``--dns`` entries rendered after the new branch-specific flags so existing fixtures match. - ``docker.container`` grows both the new keyword arguments and the docstring bullets, forwarding everything through ``ContainerSpec``.
Collaborator
Author
|
@Fizzadar just fixed the conflict |
DonDebonair
reviewed
Apr 19, 2026
| if self.privileged: | ||
| args.append("--privileged") | ||
|
|
||
| if self.hostname: |
Collaborator
There was a problem hiding this comment.
Nitpick: why not explicitly use if self.hostname is not None, just like withg self.cpu? Same goes for the other params.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add mount, privileged, hostname, entrypoint, user, cpus, memory and extra_args to container
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)