Open roberth opened 2 years ago
@purcell As the author of streamLayeredImage
, would you be interested in optimizing it further by adding nix2container
support?
Hey, thanks so much for tagging me in — I'd be keen to see this happen, but I'm currently going to struggle to find time to help with it myself sorry.
This would be really good, I haven't looked into the details. But would be nice to have this as part of the native nixpkgs tooling.
Is it mainly about supporting the manifest/skopeo integration or do we want to go deeper and support the layering functionality that is supported in nix2container
? I am currently using that and it is pretty neat.
Not the same format, but it was possible to use the streamLayeredImage
output with skopeo
like this:
./result | gzip -1 | skopeo --insecure-policy copy docker-archive:/dev/stdin containers-storage:xyz:123
Since that is supported the destination could be anything that skopeo supports. I am not sure about the performance of this yet though.
So would the plan be to create a patched skopeo
in nixpkgs and then also support outputting in this format?
I think it could work like this:
streamLayeredImage
produces a standards conforming imagedockerTools
always produces a nix2container
image internallynix2container
image onlyThis lets us get rid of some custom bash as well as the stream_layered_image.py
script.
(I'm sure skopeo is at least as efficient, as that's part of the nix2container
story anyway.)
IIRC the nix2container
format is distinct but probably equivalent to the json we produce internally as input to the streamLayeredImage
program:
Project description
nix2container uses a custom format to represent images, similar to what
streamLayeredImage
does internally, and it goes a step further by integrating this format into container tooling (custom skopeo plugin) to further optimize loading and uploading.Let's support this format in
dockerTools
!streamLayeredImage
was introduced in https://github.com/NixOS/nixpkgs/pull/91084Metadata