Container Image
@swamp/container-imagev2026.07.20.1
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 |
Not supported (host arch only) |
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. Captures the pushed digest. |
Security
loginpassword is annotated withsensitive: trueand 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 --json02Models
@swamp/container-imagev2026.07.20.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.
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,
03Stats
A
100 / 100
Downloads
0
Archive size
23.5 KB
Verified by Swamp
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
04Platforms
05Labels