Skip to content
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

tar file to large for dockerbuild to handle #128

Closed
anandkumarpatel opened this issue Apr 2, 2015 · 2 comments
Closed

tar file to large for dockerbuild to handle #128

anandkumarpatel opened this issue Apr 2, 2015 · 2 comments

Comments

@anandkumarpatel
Copy link

I have a tar file which is 1.1gb, it fails to send to docker due to stack below. Is there a way to do this streaming and not using fs.readFileSync?

dockerode called like so:

docker.buildImage('file.tar', cb)

stack

buffer.js:194                                                                                                                                            
      this.parent = new SlowBuffer(this.length);                                                                                                         
                    ^                                                                                                                                    
RangeError: length > kMaxLength                                                                                                                          
    at new Buffer (buffer.js:194:21)                                                                                                                     
    at Object.fs.readFileSync (fs.js:309:16)                                                                                                             
    at Modem.dial (/source/node_modules/dockerode/node_modules/docker-modem/lib/modem.js:117:17)                                                         
    at Docker.buildImage (/source/node_modules/dockerode/lib/docker.js:146:14)                                                                           
    at Builder.startImageBuild (/source/lib/steps/build.js:45:15)  
@anandkumarpatel
Copy link
Author

I just found out you can pass tar stream as argument, might want to include that in the README and/or code comment?

@apocas
Copy link
Owner

apocas commented Apr 2, 2015

There's already an example of this in the examples folder :)
https://github.com/apocas/dockerode/blob/master/examples/build/build_img_cwd.js

I guess I will also add a note to the readme saying it also accepts a stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants