Skip to content

@podman Connector

The Podman connector allows you to use pyinfra to create new Podman images or modify running Podman containers.

Note

The Podman connector allows pyinfra to target Podman containers as inventory and is unrelated to the :doc:../operations/docker & :doc:../facts/docker.

You can pass either an image name or existing container ID:

  • Image - will create a new container from the image, execute operations against it, save into a new Podman image and remove the container
  • Existing container ID - will execute operations against the running container, leaving it running
# A Podman base image must be provided
pyinfra @podman/alpine:3.8 ...

# pyinfra can run on multiple Docker images in parallel
pyinfra @podman/alpine:3.8,@podman/ubuntu:bionic ...

# Execute against a running container
pyinfra @podman/2beb8c15a1b1 ...

The Podman connector is great for testing pyinfra operations locally, rather than connecting to a remote host over SSH each time. This gives you a fast, local-first devloop to iterate on when writing deploys, operations or facts.

Note

For running Podman containers on remote hosts, see the :doc:podmanssh connector.

Examples

pyinfra @podman/name ...

Available Data

The following keys can be set as host or group data to control how this connector interacts with the target.

Key Description Type Default
docker_identifier ID of container or image to start from str
docker_platform Platform to use for Docker image (e.g., linux/amd64) str
docker_architecture Architecture to use for Docker image (e.g., amd64, arm64) str