ory / dockertest

Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=dockertest
Apache License 2.0
4.1k stars 243 forks source link

dockertest does not support buildkit #525

Open pjh opened 4 weeks ago

pjh commented 4 weeks ago

Preflight checklist

Ory Network Project

No response

Describe the bug

Dockertest does not yet support BuildKit (docker buildx) for building images from a Dockerfile. For example, when I try to use dockertest to build my backend server for testing I get this failure:

$ go test -C integration/
failed to build and run backend container: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled

BuildKit is widely used for building docker images. https://github.com/ory/dockertest/pull/416 was proposed over a year ago but it has not yet been merged. Could that change plus whatever other support is needed be prioritized?

Reproducing the bug

  1. Write a Dockerfile with a step that attempts to mount a file. For example: RUN --mount=type=secret,id=netrc_file go build ...
  2. Attempt to build the image using one of dockertest's build methods, such as: container, err := pool.BuildAndRunWithOptions("path/to/Dockerfile", runOpts, hostConfigModifier)

Relevant log output

No response

Relevant configuration

No response

Version

github.com/ory/dockertest/v3 v3.10.0

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response