-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow building with BuildKit #761
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @schummar, thanks for the contribution! Because build kit is the default image builder I'd say this should be the default behaviour. However because this implementation requires a separate container for the build, as well as copying potentially large files between images, I'm concerned about performance, which I assume is significantly worse when compared to a non-buildkit build. If we make this functionality opt-in (keeping withBuildKit), then I'm concerned about maintenance as it's a large and complex change. I haven't run the tests yet but I'm assuming issues with other container runtimes like podman too. My plan was to wait for build kit to be natively supported by Docker engine and Dockerode, which should result in no or minor changes and no performance impact. |
Fair enough. I think the performance might not too bad in comparison. BuildKit builds are usually run in a container anyway, as far as I know - but my knowledge there is admittedly limited. I totally get the reluctance to add the complexity though. Unfortunately, it's unclear when this might be supported (the referenced issues are 3,5 years old at this point). Usage of BuildKit features is getting more common - my very first try with testcontainers immediately failed because of this 😉. So, it would be good to have some kind of solution. What do you think about these options:
|
@cristianrgreco when you have a minute, could you give feedback? |
083e539
to
5794664
Compare
Ok, completely new development: As @mikeseese pointed out (#571 (comment)), the version flag is in fact working. Upon investigation I found that I can make it work from testcontainers as well with one caveat: When passing That make this PR so much more concise! More open questions:
Edit: Well shit, the same problem arises when the image used in the |
Hi @schummar, thanks for staying on top of this issue! I've checked out this branch and run the test |
A simple manual way to reproduce it is to run Then run I can try and come up with a test case later. Removing images is not covered by the ContainerRuntimeClient, so I have to find a way around that. |
Adds a
withBuildKit
option. With the option enabled, a build will be done using BuildKit - within a docker container.This should be relatively independent on the host system's BuildKit support.
Questions:
DOCKER_BUILDKIT=1
enabled the setting by default?Solves #571