Skip to content

Commit

Permalink
only need to support linux for running containers
Browse files Browse the repository at this point in the history
MacOS cannot run containers natively. M1/M2 defaults to linux/arm64 so
the "os" field as part of --platform only needs to use linux/ as a
default with GOARCH read in for the particular CPU architecture. Same
deal with Windows, Docker on windows is virtualized Linux (AFAIU)
  • Loading branch information
coopernetes committed Oct 16, 2023
1 parent 20e1fc8 commit c5cef30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/container-structure-test/app/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func AddTestFlags(cmd *cobra.Command) {
cmd.Flags().StringVarP(&opts.Driver, "driver", "d", "docker", "driver to use when running tests")
cmd.Flags().StringVar(&opts.Metadata, "metadata", "", "path to image metadata file")
cmd.Flags().StringVar(&opts.Runtime, "runtime", "", "runtime to use with docker driver")
cmd.Flags().StringVar(&opts.Platform, "platform", fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), "Set platform if host is multi-platform capable")
cmd.Flags().StringVar(&opts.Platform, "platform", fmt.Sprintf("linux/%s", runtime.GOARCH), "Set platform if host is multi-platform capable")
cmd.Flags().BoolVar(&opts.Pull, "pull", false, "force a pull of the image before running tests")
cmd.MarkFlagsMutuallyExclusive("image-from-oci-layout", "pull")
cmd.Flags().BoolVar(&opts.Save, "save", false, "preserve created containers after test run")
Expand Down

0 comments on commit c5cef30

Please sign in to comment.