bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Work with remote podman containers

Open puppetjoy opened this issue 1 year ago • 0 comments

Use Case

For working with containers from within a container, I bind-mount /run/podman/podman.sock from the host and use podman-remote. Bolt only calls the local podman command to interact with containers.

Describe the Solution You Would Like

Add a podman transport option that accepts any valid Podman URL from podman-remote(1), including examples like:

  • unix:///run/user/$UID/podman/podman.sock
  • ssh://notroot@localhost:22/run/user/$UID/podman/podman.sock
  • ssh://root@localhost:22/run/podman/podman.sock
  • tcp://localhost:34451
  • tcp://127.0.0.1:34451

When this new option is set, Bolt should call podman-remote --url=VALUE to interact with containers.

Describe Alternatives You've Considered

As a workaround, I prepare my management container with:

# Force podman remote operations (bolt hardcodes podman)
file { '/usr/bin/podman':
  ensure => link,
  target => '/usr/bin/podman-remote',
}

That will cause bolt to work with /run/podman/podman.sock for all containers. One could set the environment variable CONNECTION_HOST to some other value. This would also apply to all containers. A transport option would allow this to be specified on a per target basis and let Bolt orchestrate tasks among many container hosts.

puppetjoy avatar Dec 21 '24 20:12 puppetjoy