Skip to content

Commit d398cdd

Browse files
Tranquility2alexanderankin
authored andcommitted
CR fix
1 parent 586e4e6 commit d398cdd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/testcontainers/core/image.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ class DockerImage:
2323
>>> with DockerImage(path="./core/tests/image_fixtures/sample/", tag="test-image") as image:
2424
... logs = image.get_logs()
2525
26-
:param tag: Tag for the image to be built (default: None)
2726
:param path: Path to the build context
27+
:param docker_client_kw: Keyword arguments to pass to the DockerClient
28+
:param tag: Tag for the image to be built (default: None)
29+
:param clean_up: Remove the image after exiting the context (default: True)
2830
:param dockerfile_path: Path to the Dockerfile within the build context path (default: Dockerfile)
2931
:param no_cache: Bypass build cache; CLI's --no-cache
32+
:param kwargs: Additional keyword arguments to pass to the underlying docker-py
3033
"""
3134

3235
def __init__(
@@ -52,9 +55,8 @@ def __init__(
5255
def build(self) -> Self:
5356
logger.info(f"Building image from {self.path}")
5457
docker_client = self.get_docker_client()
55-
kwargs = self._kwargs
5658
self._image, self._logs = docker_client.build(
57-
path=str(self.path), tag=self.tag, dockerfile=self._dockerfile_path, nocache=self._no_cache, **kwargs
59+
path=str(self.path), tag=self.tag, dockerfile=self._dockerfile_path, nocache=self._no_cache, **self._kwargs
5860
)
5961
logger.info(f"Built image {self.short_id} with tag {self.tag}")
6062
return self

0 commit comments

Comments
 (0)