Closed DanielHabenicht closed 1 year ago
Seems like its not a Testcontainers issue by itself, it only occurs with BuilKit disabled (e.g. $env:DOCKER_BUILDKIT = 0
). Is there a way to build with buildkit enabled?
The legacy docker build engine seems to recreate the folder that is created in the step before, thus erroring in the subsequent step as it is empty.
Removing intermediate container 548e0b6db0ab
Interessting observation, I think due to Docker removing the intermediate layer, the previous steps are not present in the final step. For example, if you look into RUN mkdir -p exampleCA
, you will notice that the exampleCA
directory is missing. That's why you receive the following error message:
/home/step/exampleCA/cakey.pem: no such file or directory
If you chain the commands and run them in a single command, it works fine.
Seems like its not a Testcontainers issue by itself, it only occurs with BuilKit disabled (e.g.
$env:DOCKER_BUILDKIT = 0
). Is there a way to build with buildkit enabled?
We encountered a similar request in Node, and it appears that BuildKit is not available through the Docker Engine API: https://github.com/testcontainers/testcontainers-node/issues/571#issuecomment-1576465904.
Yeah, I resolved it for now by writing the files into the /tmp
directory which does not seem to be reset between layers.
The idea for another folder came from this comment: https://forums.docker.com/t/resolved-files-missing-after-dockerfile-run-downloads-them/4827
We encountered a similar request in Node, and it appears that BuildKit is not available through the Docker Engine API: https://github.com/testcontainers/testcontainers-node/issues/571#issuecomment-1576465904.
Hopefully that will change as they deprecate it and add an EoL
I dont't know where to file it, but probably a central ticket for buildkit compatibiliy would be better than one in each seperate project. Are the container build by ressource reaper or by each testcontainers implementation individually?
If you like, we can create it here. I can pin the issue and forward it to the other Testcontainers maintainers.
Testcontainers version
3.2.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x64
.NET version
6.0.404
Docker version
Docker info
What happened?
Following Dockerfile buils with docker but not with Testcontainers:
via
Relevant log output
Additional information
Works if executed with
docker build .
Seems like testcontainers is still using the old docker build pipeline and not buildkit?