How to use the podman.Client function in podman

To help you get started, we’ve selected a few podman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github containers / python-podman / test / test_images.py View on Github external
def loadCache(self):
        with podman.Client(self.host) as pclient:
            self.images = list(pclient.images.list())

        self.alpine_image = next(
            iter(
                [
                    i
                    for i in self.images
                    if "docker.io/library/alpine:latest" in i["repoTags"]
                ]
                or []
            ),
            None,
        )

        return self.images
github containers / python-podman / test / test_pods_no_ctnrs.py View on Github external
def setUp(self):
        self.tmpdir = os.environ['TMPDIR']
        self.host = os.environ['PODMAN_HOST']

        self.pclient = podman.Client(self.host)
github containers / python-podman / test / test_images.py View on Github external
def setUp(self):
        self.tmpdir = os.environ["TMPDIR"]
        self.host = os.environ["PODMAN_HOST"]

        self.pclient = podman.Client(self.host)
        self.images = self.loadCache()
github containers / python-podman / pypodman / pypodman / lib / action_base.py View on Github external
def client(self):
        """Podman remote client for communicating."""
        if self._args.host is None:
            return podman.Client(uri=self.local_uri)
        return podman.Client(
            uri=self.local_uri,
            remote_uri=self.remote_uri,
            identity_file=self.identity_file,
            ignore_hosts=self.ignore_hosts,
            known_hosts=self.known_hosts)
github containers / python-podman / pypodman / pypodman / lib / action_base.py View on Github external
def client(self):
        """Podman remote client for communicating."""
        if self._args.host is None:
            return podman.Client(uri=self.local_uri)
        return podman.Client(
            uri=self.local_uri,
            remote_uri=self.remote_uri,
            identity_file=self.identity_file,
            ignore_hosts=self.ignore_hosts,
            known_hosts=self.known_hosts)
github containers / podman / contrib / python / podman / examples / eg_inspect_fedora.py View on Github external
#!/usr/bin/env python3
"""Example: Pull Fedora and inspect image and container."""

import podman

print('{}\n'.format(__doc__))

with podman.Client() as client:
    id = client.images.pull('registry.fedoraproject.org/fedora:28')
    img = client.images.get(id)
    print(img.inspect())

    cntr = img.create()
    print(cntr.inspect())

    cntr.remove()
github containers / python-podman / examples / eg_inspect_fedora.py View on Github external
#!/usr/bin/env python3
"""Example: Pull Fedora and inspect image and container."""

import podman

print('{}\n'.format(__doc__))

with podman.Client() as client:
    id = client.images.pull('registry.fedoraproject.org/fedora:28')
    img = client.images.get(id)
    print(img.inspect())

    cntr = img.create()
    print(cntr.inspect())

    cntr.remove()
github containers / podman / contrib / python / pypodman / pypodman / lib / action_base.py View on Github external
def client(self):
        """Podman remote client for communicating."""
        if self._args.host is None:
            return podman.Client(uri=self.local_uri)
        return podman.Client(
            uri=self.local_uri,
            remote_uri=self.remote_uri,
            identity_file=self.identity_file)
github containers / podman / contrib / python / podman / examples / eg_image_list.py View on Github external
#!/usr/bin/env python3
"""Example: Show all images on system."""

import podman

print('{}\n'.format(__doc__))

with podman.Client() as client:
    for img in client.images.list():
        print(img)