dockerode
dockerode copied to clipboard
buildImage() stream silently fails when build context is too large
Today I stumbled upon a problem where the buildImage() function would silently fail when the passed-in build context is too large.
Here's my call:
const stream = await docker.buildImage({ context }, { dockerfile, t })
return new Promise((resolve, reject) => {
docker.modem.followProgress(stream, (err, res) => {
if (err) {
reject(err)
}
resolve(res)
})
})
And the context is a path to a directory which has a bunch of files. In my case the context included a large node_modules directory.
Same issue here after updating to v3.
In my case the package-lock.json file was the large file.
suggest you use an older version for now
Could you give more details about this? How so "too large"? Larger than what?
Is it only happening on v3.x?
Could be related to this: https://github.com/apocas/dockerode/pull/490
+1, had this for a package-lock.json of 308K and node_modules of 30K. Version 3.0.2.
I can verify that this issue is happening after upgrading to v3.x (working fine with 2.5.8). Not sure if it's related to big files or not but surely works after I remove the folder with big files in it. Otherwise it silently gets stuck. No output, no promise resolving, nothing.
Could someone test the branch https://github.com/apocas/dockerode/tree/debug-build against this?
@apocas Same problem here. With your branch (debug-build), the build worked correctly.
Humm so the issue was in the change of tar.pack. I will revert it and publish.
https://github.com/apocas/dockerode/commit/bd5fd1867997f70180d8da6b57807a993c880ca8