Skip to content

Commit

Permalink
fix a single-component issue for building docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-lolo committed Aug 16, 2024
1 parent d63d463 commit c4385ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion rats-devtools/src/python/rats/kuberuntime/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def component_runtime(name: str) -> apps.ServiceId[apps.Runtime]:

@staticmethod
def component_command(name: str) -> apps.ServiceId[tuple[str, ...]]:
return apps.ServiceId[tuple[str, ...]](f"{PluginServices.K8S_RUNTIME}[{name}][command]")
return apps.ServiceId[tuple[str, ...]](
f"{PluginServices.K8S_RUNTIME.name}[{name}][command]",
)


class PluginContainer(apps.Container):
Expand Down
12 changes: 10 additions & 2 deletions rats-devtools/src/python/rats/projects/_project_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build_component_image(self, name: str) -> None:
component_tools = self.get_component(name)
file = component_tools.find_path("Containerfile")
if not file.exists():
file = component_tools.find_path("Containerfile")
file = component_tools.find_path("Dockerfile")

if not file.exists():
raise RuntimeError(f"Containerfile not found in component {name}")
Expand All @@ -51,7 +51,15 @@ def build_component_image(self, name: str) -> None:
)

print(f"building docker image: {image.full}")
component_tools.exe("docker", "build", "-t", image.full, "--file", str(file), "../")
component_tools.exe(
"docker",
"build",
"-t",
image.full,
"--file",
str(file),
str(self.repo_root()),
)

if image.name.split("/")[0].split(".")[1:3] == ["azurecr", "io"]:
acr_registry = image.name.split(".")[0]
Expand Down

0 comments on commit c4385ce

Please sign in to comment.