Skip to main content

weft-docker

Docker runner plugin for Weft.

This extension adds the docker runner via the weft.runners entry-point group. It supports one-shot command TaskSpecs and the Docker-backed one-shot provider CLI agent lane documented in Weft's agent runtime spec.

Security note. Weft assumes user-level trust (see docs/specifications/00-Overview_and_Architecture.md). spec.runner.options.docker_args is a passthrough to docker run: managed flags (--memory, --network, --volume, …) are validated against collisions, but escape-hatch flags such as --privileged, --cap-add, --security-opt, --pid=host, and -v /:/host are not blocked. A task author who can set docker_args can therefore weaken or defeat the container isolation; treat docker_args as equivalent to local docker run access, not as a sandbox boundary.

Current host support:

  • Linux: supported
  • macOS: supported
  • Windows: not currently supported

Container Profiles

Command tasks can select a project-local Docker container profile through spec.runner.options.container_profile. Profiles are useful when the Weft manager runs on the host but the task must run inside a Docker network where service names such as db, redis, or internal-api resolve.

TaskSpec shape:

{
  "spec": {
    "type": "command",
    "process_target": "python3",
    "args": ["-m", "my_project.probe"],
    "runner": {
      "name": "docker",
      "options": {
        "container_profile": "ops"
      }
    }
  }
}

By default, profiles are loaded from .weft/docker-profiles.toml. A task can override that with spec.runner.options.container_profile_file.

version = 1

# Optional. Relative values are resolved from this file's directory.
root = ".."

[profiles.ops]
image = "ghcr.io/example/project:latest"
network = "project_ops"
mount_workdir = false
container_workdir = "/app/project"
env_from_host = ["OPTIONAL_TOKEN"]
required_env_from_host = ["REQUIRED_TOKEN"]

[profiles.ops.env]
SERVICE_URL = "https://internal-api:8443"

[[profiles.ops.mounts]]
source = "config"
target = "/app/project/config"
read_only = true

Profile values are defaults. Explicit TaskSpec spec.runner.options and spec.env win over profile values. env_from_host forwards named host environment variables when present. required_env_from_host requires the merged task environment to contain the named value, either from host env, profile env, or explicit TaskSpec env.

Relative profile mount and build paths resolve against container_profile_root, then top-level TOML root, then the profile file's directory. Runtime checks for named Docker networks and profile-sourced mount or build paths run only during explicit preflight validation.

Container profiles currently apply to command tasks only. Docker-backed agent tasks continue to use provider-specific image recipes, container runtime descriptors, and work_item_mounts.

Release tag:

  • weft_docker/vX.Y.Z

Release files for weft-docker 0.9.75

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weft-docker 0.9.75
File Size Uploaded
weft_docker-0.9.75.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for weft-docker 0.9.75
File Interpreter ABI Platform
weft_docker-0.9.75-py3-none-any.whl Python 3 none any Details

Total release size: 53.9 kB

Release files / weft_docker-0.9.75.tar.gz

Download URL weft_docker-0.9.75.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
70103c497a5c513d31aacedcb7c7fc57af0bb19488d59961bd0f87cc693c2bf6
BLAKE2b-256 checksum
How to use checksums
066d508880869a99fac2bea5d2fe09fb9ee181d905c75bb5c5ed5ad2630cb848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / weft_docker-0.9.75-py3-none-any.whl

Download URL weft_docker-0.9.75-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5813eb74e4e728bd85bccd089d7dabc023cec69066a9dba3b168c4433e88903a
BLAKE2b-256 checksum
How to use checksums
b7abbce4273306663d9bbeb0b50440c431a2afbb5b44bb11286d0e33a3ea2f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.9.82

2 release files

0.9.81

2 release files

0.9.80

2 release files

0.9.79

2 release files

0.9.78

2 release files

0.9.77

2 release files

0.9.76

2 release files

This release

0.9.75 This release

2 release files

0.9.73

2 release files

0.9.72

2 release files

0.9.70

2 release files

0.9.26

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page