dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

buildImage() stream silently fails when build context is too large

Open pmuens opened this issue 6 years ago • 9 comments

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.

pmuens avatar Oct 18 '19 16:10 pmuens

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

dannyhuly avatar Oct 24 '19 11:10 dannyhuly

Could you give more details about this? How so "too large"? Larger than what?

apocas avatar Oct 24 '19 11:10 apocas

Is it only happening on v3.x?

Could be related to this: https://github.com/apocas/dockerode/pull/490

apocas avatar Oct 24 '19 11:10 apocas

+1, had this for a package-lock.json of 308K and node_modules of 30K. Version 3.0.2.

jmahhh avatar Jan 01 '20 20:01 jmahhh

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.

ilkancelikMA avatar Jan 10 '20 14:01 ilkancelikMA

Could someone test the branch https://github.com/apocas/dockerode/tree/debug-build against this?

apocas avatar Feb 05 '20 02:02 apocas

@apocas Same problem here. With your branch (debug-build), the build worked correctly.

killerall avatar Feb 27 '20 16:02 killerall

Humm so the issue was in the change of tar.pack. I will revert it and publish.

apocas avatar Mar 17 '20 12:03 apocas

https://github.com/apocas/dockerode/commit/bd5fd1867997f70180d8da6b57807a993c880ca8

apocas avatar Mar 17 '20 12:03 apocas