Skip to content

[Sandbox] Allow Docker sandboxes to set container labels #4562

Description

@koadegno

Please read this first

  • Have you read the docs? Yes. I reviewed the sandbox client documentation and the current Docker sandbox implementation.
  • Have you searched for related issues? Yes. I searched open and closed issues and pull requests for Docker sandbox labels, container labels, DockerSandboxClientOptions labels, and Docker container metadata. I did not find an existing request covering this capability.

Describe the feature

I would like DockerSandboxClientOptions to support optional Docker container labels.

Docker labels are standard container metadata for identifying and managing containers with existing Docker tooling. The Docker Python SDK supports labels when creating a container, but DockerSandboxClient does not currently expose this option.

Proposed API:

DockerSandboxClientOptions(
    image="python:3.14-slim",
    labels={"com.example.owner": "worker-123"},
)

The option would be additive and optional. When omitted, Docker container creation would remain unchanged.

Labels would also be preserved in DockerSandboxSessionState so replacement containers created during resume() retain the configured metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions