Skip to main content

Container Image

@swamp/container-imagev2026.10.24.1· AGPL-3.0-or-later· 3d agoBEHAVIORS
01README

Build, run, and push container images via Docker, Podman, or Apple Containers. Select your runtime once via globalArguments.binary and every method invokes the right CLI transparently. Each method writes a typed resource so workflows can chain them via CEL.

Runtime Support Matrix

Method Docker Podman Apple Containers
build docker build podman build container build
run docker run --rm podman run --rm container run --rm
login docker login podman login container registry login
push docker push podman push container image push
multi-platform-build docker buildx build podman build --platform + push container build --platform + push

Methods

Method What it does
validate Check runtime, daemon, and multi-platform support. Fail fast on missing deps.
build Build a container image from a Dockerfile. Optional OCI/Docker archive export.
run Run a container with --rm. Captures stdout and stderr.
login Log into a registry. Password piped via --password-stdin, never in argv.
push Push a container image to a registry. Captures the pushed digest.
multi-platform-build Multi-platform build and optional push, with optional OCI annotations. Captures the pushed digest.

Security

  • login password is annotated with sensitive: true and piped via --password-stdin. It never appears in argv, resources, or logs.
  • User-controlled strings are guarded against newline and NUL injection.

Usage

swamp extension pull @swamp/container-image
swamp model create @swamp/container-image myapp
swamp model edit myapp   # set binary: podman if needed

swamp model method run myapp build --input tag=myapp:latest --json
swamp model method run myapp run --input image=myapp:latest --json
02Behaviors1
@swamp/container-imagev2026.10.24.1container_image.ts
fn validate()
Check that the container runtime is installed, the daemon is
fn build()
Build a container image from a Dockerfile. Supports OCI output format.
fn run()
Run a container image with --rm. Captures stdout and stderr.
fn login()
Log into a container registry. Password is piped via --password-stdin
fn push()
Push a container image to a registry. Captures the pushed digest.
fn multi-platform-build()
Multi-platform build and optional push. Docker uses buildx; Podman

Resources

validateResult(infinite)— Outcome of a `validate` invocation — runtime presence, daemon
buildResult(infinite)— Outcome of a `build` invocation — tag, exit code, and captured output.
runResult(infinite)— Outcome of a `run` invocation — image, exit code, stdout, and stderr.
loginResult(infinite)— Outcome of a `login` invocation — server, username, and exit code.
multiPlatformBuildResult(infinite)— Outcome of a `multi-platform-build` invocation — platforms, tags,
pushResult(infinite)— Outcome of a `push` invocation — image reference, pushed digest,
03Previous Versions6
2026.10.23.1AGPL-3.0-or-later
2026.10.22.1AGPL-3.0-or-later(was none)
2026.10.13.1

Modified 1 behaviors

2026.08.25.2
2026.08.25.1
2026.07.20.1
04Stats
A
93 / 100
Downloads
893
Archive size
23.1 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented0/1missing
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels