diff --git a/docker/image.go b/docker/image.go index f5da78ef..9e4ed841 100644 --- a/docker/image.go +++ b/docker/image.go @@ -480,6 +480,7 @@ type BuildImageOptions struct { SecurityOpt []string `qs:"securityopt"` Target string `gs:"target"` Platform string `qs:"platform"` + Version string `qs:"version"` Context context.Context } diff --git a/dockertest.go b/dockertest.go index 545e5098..362e4d83 100644 --- a/dockertest.go +++ b/dockertest.go @@ -331,6 +331,8 @@ type BuildOptions struct { ContextDir string BuildArgs []dc.BuildArg Platform string + // Version specifies the builder to use. "1" for classic, "2" for BuildKit + Version string } // BuildAndRunWithBuildOptions builds and starts a docker container. @@ -343,6 +345,7 @@ func (d *Pool) BuildAndRunWithBuildOptions(buildOpts *BuildOptions, runOpts *Run ContextDir: buildOpts.ContextDir, BuildArgs: buildOpts.BuildArgs, Platform: buildOpts.Platform, + Version: buildOpts.Version, }) if err != nil {