Skip to content

Commit b1e5130

Browse files
committed
fix: image build
1 parent b83bc11 commit b1e5130

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

core/testcontainers/core/docker_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def run(
115115
return container
116116

117117
@_wrapped_image_collection
118-
def build(self, path: str, tag: str, rm: bool = True, **kwargs: Any) -> tuple[Image, Iterable[dict[str, Any]]]:
118+
def build(
119+
self, path: str, tag: Optional[str], rm: bool = True, **kwargs: Any
120+
) -> tuple[Image, Iterable[dict[str, Any]]]:
119121
"""
120122
Build a Docker image from a directory containing the Dockerfile.
121123

core/testcontainers/core/image.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ def build(self) -> Self:
5959
logger.info(f"Building image from {self.path}")
6060
docker_client = self.get_docker_client()
6161
self._image, self._logs = docker_client.build(
62-
path=str(self.path),
63-
dockerfile=self._dockerfile_path,
64-
nocache=self._no_cache,
65-
**{**({"tag": self.tag} if self.tag else {}), **self._kwargs},
62+
path=str(self.path), tag=self.tag, dockerfile=self._dockerfile_path, nocache=self._no_cache, **self._kwargs
6663
)
6764
logger.info(f"Built image {self.short_id} with tag {self.tag}")
6865
return self

0 commit comments

Comments
 (0)