-
Notifications
You must be signed in to change notification settings - Fork 52
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
Build within nix2container image: "Digest did not match" from Skopeo #97
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I will take a look later, but to debug such kind of issues, i will do something such as explained in this comment: #23 (comment) This would allow you to compare files in the layer produced at build time to the files in the layer produced at push time. |
This comment was marked as outdated.
This comment was marked as outdated.
Hi @nlewo, Tried to debug this some more and wrote my findings in here https://gitlab.com/nexxiot-labs/nix2container-checksum/-/blob/465dd01ba20887fea1457c4205713b7ae291b99a/README.md Everything is hopefully reproducible by executing commands such as
Which also contain debug info. Maybe the most surprising result first: All layers except the top-level layer are actually the same between working and non-working builds. Only the top-level image layer also containing the nix-database differs. If you add a package to that top-level layer (I did that with I assume that some incorrect substitution happens otherwise, not sure. The non-working solution also have content-addressable hashes in the closuregraph for some reason. |
I'd be happy to debug that together. I am in the CET time zone and are rather flexible. |
Hi @nlewo, I updated my PR quite significantly: With this PR in place, most things are deterministic. Very weirdly, if you set I stared long and hard at functions such as But they honestly look quite nicely written and good to me 🤷 |
I also updated the README/code of https://gitlab.com/nexxiot-labs/nix2container-checksum so that it should be quite straight-forward to repo. At least for me, it is fully reproducible. |
This comment was marked as outdated.
This comment was marked as outdated.
Within the nix run .#aarch64-linux.gitlab.containers.only-stdenv.copyTo oci:test-oci from nix2container-checksum which is build by: only-stdenv = nix2container.buildImage {
name = "only-stdenv";
copyToRoot = [nixpkgs.stdenv];
}; With my fixes from #96 and without stdenv, it actually works now! :) |
I cannot reproduce the issue anymore 🤷 |
Problem
When building docker images with nix2container within an image build with nix2container, I am getting weird errors like this:
Reproduction
This repo contains everything to reproduce the error for me.
With docker and local copy:
nix run -L .\#containers.x86_64-linux.nix-ci.copyToDockerDaemon
docker run --privileged -v $PWD:/workspace -v ~/.docker:/home/user/.docker --workdir /workspace -it $(nix eval --raw ".#containers.x86_64-linux.nix-ci.imageRefUnsafe") nix run .\#containers.x86_64-linux.nix-ci.copyTo oci:oci_sample_inside
Ideas
I wonder if it is some sort of store path corruption?
I build it with and without #96:
The text was updated successfully, but these errors were encountered: