Relationships
#5188 docker_container: add extraArgs/runArgs passthrough for arbitrary run flags (e.g. --init)
Opened by kneel · 11/28/2026
Problem
@swamp/cfgmgmt/docker_container (observed 2026.11.17.1) has no first-class
field to pass arbitrary podman/docker run flags to the container at creation
time. The input schema is additionalProperties: false and exposes only:
name, image, ensure, ports, environment, volumes, restart, command, network, and
the node/become connection fields. There is no extraArgs, runArgs,
podmanArgs, entrypoint, or init property, and because unknown properties
are rejected there is no escape hatch.
The existing command field only overrides the container command (the args
passed to the entrypoint); it cannot set run-time daemon flags such as --init,
--cap-add, --security-opt, --ulimit, --sysctl, --device, etc.
Concrete consequence
Some base images ship an init (for example tini) but deliberately clear the
entrypoint (ENTRYPOINT []), expecting the operator to opt back in to an init
via the engine's --init flag. With this type there is no declarative way to do
that. A long-lived container that forks child processes then has no PID 1 reaper,
so exited children accumulate as zombies.
The current workaround is to prepend the init binary inside the command field.
That works, but it is image-specific (the init binary path varies by image), it
conflates "which init" with "what command to run", and it is a workaround rather
than a declared seam. Any run flag that is not an argv override (the capability,
device, sysctl, and ulimit examples above) has no workaround at all.
Proposed solution
Add a declarative passthrough to the docker_container type, for example:
extraArgs:
- "--init"
- "--cap-add=NET_ADMIN"(or the name runArgs / podmanArgs -- naming to the maintainers' preference).
The values would be inserted into the engine run/create invocation ahead of
the image reference. Optionally a convenience boolean such as init: true that
expands to --init.
Alternatives considered
- Keep using the
command-prepend workaround: image-specific, brittle, and does not cover non-argv flags at all. - Fork/vendor the extension to add the field locally: avoidable maintenance burden for what is a small, generally useful schema addition.
Precedent
The equivalent gap was already recognized and closed for a sibling type:
Lab issue #1799 added extraArgs (and discussed privileged) to
@swamp/container-image's run method. This request asks for the same
capability on the declarative docker_container resource type, where it is
currently absent.
Environment
- Extension:
@swamp/cfgmgmt@2026.11.17.1 - Type:
@swamp/cfgmgmt/docker_container - swamp:
20261124.230941.0-sha.6a630211 - OS: linux
Upstream repository: https://github.com/swamp-club/swamp-extensions
Environment
- Extension:
@swamp/cfgmgmt@2026.11.17.1 - swamp:
20261124.230941.0-sha.6a630211 - OS:
linux(x86_64) - Deno:
2.9.8 - Shell:
/bin/zsh
Open
No activity in this phase yet.
system commented 11/28/2026, 3:30:13 PM
Classified automatically when this issue was filed.
- Source: Extensions
If you feel this classification is incorrect, add a ripple to tell us so.
Sign in to post a ripple.