-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
dockertools.buildLayeredImage fails with jq: Argument list too long
#140908
Comments
Does this also happen with #122608? |
It does not happen with #122608. I created a patch (before I read your comment) to pass the layers via the store instead via the command line. I noticed #122608 does the same, except using the discouraged I submitted the patch anyway so we can fix this without waiting for #122608 to land. |
Don't worry about the potential conflict. If you have that many layers, you'll probably benefit from #141050. Would you be interested in contributing to that? |
I thought so too, that's why I submitted it ;) |
Oh 😆 copy paste error. I intended to ask about #122608. |
I marked this as stale due to inactivity. → More info |
When building a docker image using `dockertools.buildLayeredImage`, the resulting image layers are passed to `jq` through the command line. When building an image with too many layers this would exceed the maximum command line argument length. Hence, we store the list of layers in the Nix store and pass them to `jq` as a file argument using `--slurpfile`. Fixes NixOS#140908.
Describe the bug
dockertools.buildLayeredImage
fails with/build/.attr-0: line 63: /nix/store/8v1x4xai13lj3q43b6ixgwgpvs66zmm3-jq-1.6-bin/bin/jq: Argument list too long
when building an image with many layers.jq
is used to build a JSON containing the image layers, and those layers are passed tojq
through the command line. At some point we're passing the max allowed argument list length resulting in the error.Steps To Reproduce
Steps to reproduce the behavior:
1.
nix-build docker.nix
Expected behavior
A docker image is build successfully.
Notify maintainers
@utdemir
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: