podman
Provides utilities and wrappers for creating and manipulating images and containers using the ‘podman’ utility.
Module Contents
- podman.podman(*args, log=True, check=True, **kwargs)
A simple wrapper for the podman(1) CLI, passing python arguments as shell arguments.
- class podman.Containerfile(contents='')
- contents = ''
- add_ssh_pubkey(key, user='root')
- write_to(path)
- class podman.Registry(name='contest-registry', host_addr='127.0.0.1')
Local podman registry as a class (instance).
- with Registry() as reg:
# pull docker.io/foobar, push it to the local registry local_image = reg.push(‘docker.io/foobar’) # push a locally-built image foobar to the local registry local_image = reg.push(‘foobar’) # local_image is ie. ‘127.0.0.1:12345/foobar’ …
- name = 'contest-registry'
- addr = '127.0.0.1'
- proc = None
- tagged
- start()
- stop()
- get_listen_addr()
Returns an (address, port) tuple the started-up registry is listening on.
- push(image)
Given an image name/url, tag that image with a local registry addr:port and push to the local started-up registry.
Returns image path on the local registry.