Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
def setUp(self):
self.tmpdir = os.environ['TMPDIR']
self.host = os.environ['PODMAN_HOST']
self.pclient = podman.Client(self.host)
def setUp(self):
self.tmpdir = os.environ["TMPDIR"]
self.host = os.environ["PODMAN_HOST"]
self.pclient = podman.Client(self.host)
self.images = self.loadCache()
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)
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)
#!/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()
#!/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()
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)
#!/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)