Skip to content

Commit

Permalink
build args --force-rm --rm can be disabled/replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Oct 13, 2023
1 parent 8d06be2 commit f03388c
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions repo2podman/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tarfile
from tempfile import TemporaryDirectory
from threading import Thread
from traitlets import Unicode
from traitlets import List, Unicode

from docker_image.reference import Reference

Expand Down Expand Up @@ -339,7 +339,16 @@ class PodmanEngine(ContainerEngine):
For example, you could use an alternative podman/docker compatible command.
Defaults to `podman` on the PATH.
""",
).tag(config=True)
config=True,
)

podman_build_args = List(
["--force-rm", "--rm"],
help="""Additional arguments passed to podman build in addition to those
set by repo2docker
""",
config=True,
)

def __init__(self, *, parent):
super().__init__(parent=parent)
Expand Down Expand Up @@ -394,10 +403,6 @@ def build(
except KeyError:
pass

cmdargs.append("--force-rm")

cmdargs.append("--rm")

if tag:
cmdargs.extend(["--tag", tag])

Expand All @@ -421,6 +426,8 @@ def build(
if kwargs:
raise ValueError("Additional kwargs not supported")

cmdargs.extend(self.podman_build_args)

# Avoid try-except so that if build errors occur they don't result in a
# confusing message about an exception whilst handling an exception
if fileobj:
Expand Down

0 comments on commit f03388c

Please sign in to comment.