Skip to content

The docker connector

The docker connector runs a deploy inside a local Docker or Podman container instead of over SSH, mirroring the baseline's @docker connector. It is selected per inventory entry with connection.connector:

inventory = [
    {
        "host": "build1",
        "connection": {
            "connector": "docker",
            "identifier": "alpine:3.20",
            "docker_cmd": "docker",
        },
    },
]

Connection options

The docker connection mapping is a closed set — an unknown or SSH-only key (say port) raises InventoryError rather than being silently ignored, the same fail-fast policy as the forbidden SSH options.

Option Purpose
connector Must be "docker" to select this connector
identifier Required: an image name or an existing container ID (the baseline's docker_identifier)
user The docker exec --user identity for every command, facts included (the baseline's docker_user)
platform docker run --platform, e.g. linux/amd64 (the baseline's docker_platform)
docker_cmd Required: the CLI binary to invoke, docker or podman — no default