Skip to content

Commit

Permalink
start containers with sleep infinity
Browse files Browse the repository at this point in the history
podman was buggy when I tried to run "podman start" on a container with
a process that had already stopped.
  • Loading branch information
ktdreyer committed Aug 27, 2024
1 parent 61211bf commit bd53cb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def podman(*args, **kwargs):
def podman_run(container, *args, **kwargs):
""" Run a command in a throwaway container """
name = f'copr-test-{container}'
args = ('run', '-it', '--replace', '--name', name, container) + args
args = ('run', '-itd', '--replace', '--name', name, container) + args
return podman(*args, **kwargs)


Expand All @@ -45,9 +45,9 @@ def find_rhel_nvrs(os_version, names):
"""
base_image = f'ubi{os_version}'
container = f'copr-test-{base_image}'
podman_run(base_image, 'sleep', 'infinity')
epel = f'https://dl.fedoraproject.org/pub/epel/epel-release-latest-{os_version}.noarch.rpm'
podman_run(base_image, 'dnf', '-y', 'install', epel)
podman('start', container)
podman('exec', container, 'dnf', '-y', 'install', epel)
output = podman('exec', container, 'dnf', 'repoquery', '-q', *names, text=True).strip()
rpms = output.splitlines()
nvrs = [parse_nvra(rpm) for rpm in rpms]
Expand Down

0 comments on commit bd53cb2

Please sign in to comment.