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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weft_docker-0.9.72.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weft_docker-0.9.72-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file weft_docker-0.9.72.tar.gz.

File metadata

  • Download URL: weft_docker-0.9.72.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for weft_docker-0.9.72.tar.gz
Algorithm Hash digest
SHA256 8bbf80c3a247c457235dd984963b878fa0053dcb4eee667f3d2d7dffe3b83671
MD5 0e90184c5f6873294294b428c585fad1
BLAKE2b-256 556c6b3b9138c4433937195b4c503c39d8fe69cde015dfe558227c00538860e6

See more details on using hashes here.

File details

Details for the file weft_docker-0.9.72-py3-none-any.whl.

File metadata

  • Download URL: weft_docker-0.9.72-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for weft_docker-0.9.72-py3-none-any.whl
Algorithm Hash digest
SHA256 e8cff54dd011953b42651ef950d55a7e16b2ce77f9cdb92aa789f16f2214828d
MD5 68570b86ebedca7aebf1b8405bdafe4b
BLAKE2b-256 aecf729b73086549fd2ee7716a79a39785738f9e3065715b5b5aa6b024d61df0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.9.72 This release

2 files

0.9.71

2 files

0.9.70

2 files

0.9.26

2 files

0.9.22

2 files

0.9.21

2 files

0.9.20

2 files

0.9.19

2 files

0.9.18

2 files

0.9.17

2 files

0.9.16

2 files

0.6.2

2 files

0.6.1

2 files

0.5.1

2 files

0.5.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page