-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[wip] dockerTools.buildImage: Switch to the format image generated by Skopeo #29660
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
[wip] dockerTools.buildImage: Switch to the format image generated by Skopeo #29660
Conversation
@kuznero @grahamc @puffnfresh @purefn @aneeshusa |
We were using 'Combined Image JSON + Filesystem Changeset Format' [1] to unpack and pack image and this patch switches to the format used by the registry. We used the 'repository' file which is not generated by Skopeo when it pulls an image. Moreover, all information of this file are also in the manifest.json file. We then use the manifest.json file instead of 'repository' file. Note also the manifest.json file is required to push an image with Skopeo. Fix NixOS#29636 [1] https://github.com/moby/moby/blob/749d90e10f989802638ae542daf54257f3bf71f2/image/spec/v1.1.md#combined-image-json--filesystem-changeset-format
1bc30dd
to
e0d1ebd
Compare
@nlewo Just tested it with
This produces following output:
Then I also tried to load it into docker just to double check that it really worked with
And as a final test I ran So, from my perspective it works. I do also plan to check if this works in the scenario of my projects. Will come back with an update a bit later. |
Just tested it with my |
Ran some tests, too and seems to work |
This change broke @nlewo can you please explain why layers are now Apart from that I think dockerTools |
@lo1tuma I was not able to find a clear documentation/spec regarding format image. I proposed this change (WIP) by doing some kind of retroengineering on image produced by Skopeo... (by supposing Skopeo knows what it does). What is the tool you are using? But it would be really nice to use a tool to pack and unpack image since it is really fragile to manually do this kind of things. |
I’m using a tool which I implemented myself. The only thing it does is to push a docker image in the |
@lo1tuma So, I think you could continue with the current implementation which seems to be the Regarding your script to push images, I use Skopeo to push them https://github.com/nlewo/nixpkgs-cloudwatt/blob/master/lib/image.nix#L35. |
@nlewo schema-v2 is AFAIK only a format for the docker registry which is unrelated to the docker image spec itself. There might be other use-cases without any docker registry involved. The nixpkgs manual says that BTW: I agree that is quite hard to find precise information in all those specs and APIs that exist around docker, IMHO the source of truth is still the docker image spec, although there are a lot of tools that support different variations of that format. |
This also breaks mesos loading the docker images.. I'll revert this for now |
We were using 'Combined Image JSON + Filesystem Changeset Format' [1] to
unpack and pack image and this patch switches to the format used by the registry.
We used the 'repository' file which is not generated by Skopeo when it
pulls an image. Moreover, all information of this file are also in the
manifest.json file.
We then use the manifest.json file instead of repository file. Note
also the manifest.json file is required to push an image with Skopeo.
Fix #29636
[1] https://github.com/moby/moby/blob/749d90e10f989802638ae542daf54257f3bf71f2/image/spec/v1.1.md#combined-image-json--filesystem-changeset-format
Things done
I successfully run
I also loaded several built images and pushed them to a local registry.
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)