File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ def build(
8080 repository_name : str | None = typer .Option (
8181 None , help = "Repository name to use for the built image"
8282 ),
83+ platforms : str | None = typer .Option (
84+ None , help = "Platform to build the image for. Please enter a comma separated list of platforms."
85+ ),
8386 push : bool = typer .Option (False , help = "Whether to push the image to the registry" ),
8487 secret : str | None = typer .Option (
8588 None ,
@@ -98,11 +101,14 @@ def build(
98101 """
99102 typer .echo (f"Building agent image from manifest: { manifest } " )
100103
104+ platform_list = platforms .split ("," ) if platforms else []
105+
101106 try :
102107 image_url = build_agent (
103108 manifest_path = manifest ,
104109 registry_url = registry ,
105110 repository_name = repository_name ,
111+ platforms = platform_list ,
106112 push = push ,
107113 secret = secret ,
108114 tag = tag ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def build_agent(
2222 manifest_path : str ,
2323 registry_url : str ,
2424 repository_name : str ,
25+ platforms : list [str ],
2526 push : bool = False ,
2627 secret : str = None ,
2728 tag : str = None ,
@@ -73,7 +74,7 @@ def build_agent(
7374 "context_path" : str (build_context .path ),
7475 "file" : str (build_context .path / build_context .dockerfile_path ),
7576 "tags" : [image_name ],
76- "platforms" : [ "linux/amd64" ] ,
77+ "platforms" : platforms ,
7778 }
7879
7980 # Add Docker build args if provided
You can’t perform that action at this time.
0 commit comments