Skip to content

Commit

Permalink
enable podman runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
tfoote committed Oct 25, 2023
1 parent ba03b84 commit c3be875
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rocker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ def generate_docker_cmd(self, command='', **kwargs):
image = image_name
else:
image = self.image_id
cmd = "docker run"
cmd = ""
podman_prefix = ""
if kwargs.get('use_podman'):
cmd += "podman run"
podman_prefix = "docker-daemon:"
else:
cmd += "docker run"

if(not kwargs.get('nocleanup')):
# remove container only if --nocleanup is not present
cmd += " --rm"
Expand All @@ -362,7 +369,7 @@ def generate_docker_cmd(self, command='', **kwargs):
if operating_mode != OPERATIONS_NON_INTERACTIVE:
# only disable for OPERATIONS_NON_INTERACTIVE
cmd += " -it"
cmd += "%(docker_args)s %(image)s %(command)s" % locals()
cmd += "%(docker_args)s %(podman_prefix)s%(image)s %(command)s" % locals()
return cmd

def run(self, command='', **kwargs):
Expand Down

0 comments on commit c3be875

Please sign in to comment.