Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Can't build the image with dockerTools.pullImage #10

Open
PierreR opened this issue May 17, 2018 · 1 comment
Open

Can't build the image with dockerTools.pullImage #10

PierreR opened this issue May 17, 2018 · 1 comment

Comments

@PierreR
Copy link

PierreR commented May 17, 2018

Given these two calls to pullImage the nixos/nix one will work without problem while the uncommented fromImage nixorg/nix will fail.

  docker = dockerTools.buildImage {
    name = "pi3r/shell";
    fromImage = dockerTools.pullImage {
      imageName = "nixorg/nix";
      imageDigest = "sha256:9cb8235b8537c4ccfad77ed29e181106ff03a7ac9db97417ead3628d52fe6a0c";
      sha256 = "045swkdqjh24pgb8kb798ya34my5ryvbikzavxi3ns8y7l0prxff";
      finalImageTag = "1";
    };
    # fromImage = dockerTools.pullImage {
    #   imageName = "nixos/nix";
    #   imageDigest = "sha256:d414c533649e405f2a5966b5019f042c84e511cf468965c9ef03719ae2b0c124";
    #   sha256 = "045swkdqjh24pgb8kb798ya34my5ryvbikzavxi3ns8y7l0prxff";
    #   finalImageTag = "2.0";
    # }
    config.Entrypoint = [ "${pkgs.bash}/bin/bash"];
    config.Env = [
      "PATH=/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin:${project}/bin:${pkgs.jq}/bin:${pkgs.pepper}/bin:${pkgs.bash}/bin"
      "NIX_PATH=/nix/var/nix/profiles/per-user/root/channels"
    ];
  };

The failure is:

Copying config sha256:65f9a18fa5d22f9bf79125d55102f9da5b5e7b7d2c920c987dbc9bce98e8df5a
 5.50 KB / 5.50 KB  0s
Writing manifest to image destination
Storing signatures
warning: path '/nix/store/z0903xp1wqjvdss8gwvjp6i2via47pnw-docker-image-nixorg-nix-1.tar' claims to be content-addressed but isn't
error: unexpected end-of-file

In both cases I am generating the imageDigest with skopeo.
I quite don't understand what's going on but I have the exact same issue with https://hub.docker.com/r/lnl7/nix so I guess the issue is not really related to nixorg/nix per se.

I am using:

{
  "url": "https://github.com/NixOS/nixpkgs.git",
  "rev": "c4f5d559dad3f86071ddb8de02a9f3ed715d13b8",
  "date": "2018-05-11T18:31:48+02:00",
  "sha256": "1d1i6s9476dkjmb6danvy2ixlv8indc94q6g49yracsz6q1sl46a",
  "fetchSubmodules": true
}

which includes the recent changes to pullImage.

Thanks for your help

@zimbatm
Copy link
Member

zimbatm commented May 18, 2018

I am not quite sure how to interpret this error.

https://github.com/NixOS/nix/blob/master/src/libstore/store-api.cc#L743-L768

I don't see where this ca variable comes from, neither the other ones

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

No branches or pull requests

2 participants