Skip to content

v4 does not support buildkit #663

@KasonBraley

Description

@KasonBraley

Preflight checklist

Ory Network Project

No response

Describe the bug

#416 added support for BuildKit when building images for v3. In v4 that support is missing on the BuildOptions type. v3's BuildOptions had a Version field to enable.

Was this intentional?

Reproducing the bug

v3's BuildOptions has the Version field to enable buildkit.

https://pkg.go.dev/github.com/ory/dockertest/v3#BuildOptions

type BuildOptions struct {
	Dockerfile string
	ContextDir string
	BuildArgs  []dc.BuildArg
	Platform   string
	// Version specifies the builder to use. "1" for classic, "2" for BuildKit
	Version string
	Auth    dc.AuthConfigurations
}

The Version field is missing from BuildOptions on v4.
https://pkg.go.dev/github.com/ory/dockertest/v4#BuildOptions

type BuildOptions struct {
	// Dockerfile is the name of the Dockerfile within the ContextDir.
	// Defaults to "Dockerfile" if empty.
	Dockerfile string

	// ContextDir is the directory containing the Dockerfile and build context.
	// This directory will be archived and sent to the Docker daemon.
	// REQUIRED - build will fail if empty.
	ContextDir string

	// Tags are the tags to apply to the built image.
	// If empty, the image name from BuildAndRun will be used.
	Tags []string

	// BuildArgs are build-time variables passed to the Dockerfile.
	// Use pointers to distinguish between empty string and unset.
	// Example: map[string]*string{"VERSION": &versionStr}
	BuildArgs map[string]*string

	// Labels are metadata to apply to the built image.
	// Example: map[string]string{"version": "1.0", "env": "test"}
	Labels map[string]string

	// NoCache disables build cache when set to true.
	// Useful for ensuring a clean build.
	NoCache bool

	// ForceRemove always removes intermediate containers, even on build failure.
	// Useful for keeping the build environment clean.
	ForceRemove bool
}

Relevant log output

Relevant configuration

Version

v4

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions