@@ -49,6 +49,14 @@ class LinuxContainerConfig(DeveloperEnvironmentConfig):
4949 }
5050 ),
5151 ] = "zsh"
52+ arch : Annotated [
53+ str | None ,
54+ msgspec .Meta (
55+ extra = {
56+ "help" : "The architecture to use e.g. `amd64` or `arm64`" ,
57+ }
58+ ),
59+ ] = None
5260
5361
5462class LinuxContainer (DeveloperEnvironmentInterface [LinuxContainerConfig ]):
@@ -81,7 +89,10 @@ def start(self) -> None:
8189 from dda .utils .retry import wait_for
8290
8391 if not self .config .no_pull :
84- self .docker .wait (["pull" , self .config .image ], message = f"Pulling image: { self .config .image } " )
92+ pull_command = ["pull" , self .config .image ]
93+ if self .config .arch is not None :
94+ pull_command .extend (("--platform" , f"linux/{ self .config .arch } " ))
95+ self .docker .wait (pull_command , message = f"Pulling image: { self .config .image } " )
8596
8697 self .shared_dir .ensure_dir ()
8798 command = [
@@ -98,6 +109,9 @@ def start(self) -> None:
98109 "-e" ,
99110 AppEnvVars .TELEMETRY_API_KEY ,
100111 ]
112+ if self .config .arch is not None :
113+ command .extend (("--platform" , f"linux/{ self .config .arch } " ))
114+
101115 for shared_shell_file in self .shell .collect_shared_files ():
102116 unix_path = shared_shell_file .relative_to (self .global_shared_dir ).as_posix ()
103117 command .extend (("-v" , f"{ shared_shell_file } :{ self .home_dir } /.shared/{ unix_path } " ))
0 commit comments