Cannot Run Container Built Using Nix

This image here is built using Nix: fedimint/fedimintd:v0.4.1

I can run this fine on Docker Desktop but trying to build on Fly results in a 127 exit code suggesting an issue with the entrypoint.

Is there anything I need to do to support nix built images on Fly?

Can confirm that it’s indeed possible since we use images built with nix.

A couple suggestions:

  1. We base our image off of alpine – I think this was to make sure it had an /etc/passwd file which solved some fly ssh issue previously
  2. We indeed populate the Cmd but not Entryponit (not sure if it’s necessary)

All-in-all, something like this works for us:

streamLayeredImage {
  ...
  fromImage = pkgs.dockerTools.pullImage {
    imageName = "alpine";
    imageDigest = ...
    finalImageName = "alpine";
    finalImageTag = ...
    sha256 = ...
  };
  contents = ...
  config = {
    Env = [
       ...
    ];
    Cmd = [
      "/bin/bash"
      "-c"
      ...
    ];
  };
}
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.