@@ -101,7 +101,7 @@ func (d *DockerDriver) Export(id string, dst io.Writer) error {
101
101
return nil
102
102
}
103
103
104
- func (d * DockerDriver ) Import (path string , changes []string , repo string ) (string , error ) {
104
+ func (d * DockerDriver ) Import (path string , changes []string , repo string , platform string ) (string , error ) {
105
105
var stdout , stderr bytes.Buffer
106
106
107
107
args := []string {"import" }
@@ -110,6 +110,10 @@ func (d *DockerDriver) Import(path string, changes []string, repo string) (strin
110
110
args = append (args , "--change" , change )
111
111
}
112
112
113
+ if platform != "" {
114
+ args = append (args , "--platform" , platform )
115
+ }
116
+
113
117
args = append (args , "-" )
114
118
args = append (args , repo )
115
119
@@ -275,15 +279,23 @@ func (d *DockerDriver) Logout(repo string) error {
275
279
return err
276
280
}
277
281
278
- func (d * DockerDriver ) Pull (image string ) error {
282
+ func (d * DockerDriver ) Pull (image string , platform string ) error {
279
283
cmd := d .newCommandWithConfig ("pull" , image )
280
284
285
+ if platform != "" {
286
+ cmd .Args = append (cmd .Args , "--platform" , platform )
287
+ }
288
+
281
289
return runAndStream (cmd , d .Ui )
282
290
}
283
291
284
- func (d * DockerDriver ) Push (name string ) error {
292
+ func (d * DockerDriver ) Push (name string , platform string ) error {
285
293
cmd := d .newCommandWithConfig ("push" , name )
286
294
295
+ if platform != "" {
296
+ cmd .Args = append (cmd .Args , "--platform" , platform )
297
+ }
298
+
287
299
return runAndStream (cmd , d .Ui )
288
300
}
289
301
@@ -331,6 +343,9 @@ func (d *DockerDriver) StartContainer(config *ContainerConfig) (string, error) {
331
343
if config .Runtime != "" {
332
344
args = append (args , "--runtime" , config .Runtime )
333
345
}
346
+ if config .Platform != "" {
347
+ args = append (args , "--platform" , config .Platform )
348
+ }
334
349
for _ , v := range config .TmpFs {
335
350
args = append (args , "--tmpfs" , v )
336
351
}
0 commit comments