docker-nix icon indicating copy to clipboard operation
docker-nix copied to clipboard

"nix-env -q" fails.

Open TerrorJack opened this issue 6 years ago • 8 comments

nix-env -q doesn't work on this image:

bash-4.4# nix-env -q --verbose
evaluating file '/nix/store/0d60i73mcv8z1m8d2m74yfn84980gfsa-nix-2.0.4/share/nix/corepkgs/derivation.nix'
evaluating file '/nix/store/bx2mbkwbsyhybxwbb2ishpyq3fbhx8dc-env-manifest.nix'
error: executing '': No such file or directory

TerrorJack avatar Aug 13 '18 07:08 TerrorJack

Right, I don't think that the ~/.nix-profile has been setup properly. Is that a problem? Usually everything is included in my shell.nix or default.nix

zimbatm avatar Aug 13 '18 18:08 zimbatm

@zimbatm Just a minor annoyance, and I'd like to take a bit of time to fix if possible. I think the whole /root is copied to the nix image right? Is there any post-processing on /root/.nix-profile required?

TerrorJack avatar Aug 14 '18 00:08 TerrorJack

Correct, the Dockerfile starts with Alpine Linux, installs Nix and then copies /nix/ and /root to a fresh layer (among other things).

Actually the profile exists, it might be another issue:

bash-4.4# cd /root/
bash-4.4# ls -la
total 16
drwxr-xr-x 4 root root 4096 Apr  6 12:37 .
drwxr-xr-x 1 root root 4096 Aug 14 10:53 ..
drwxr-xr-x 3 root root 4096 Apr  6 12:35 .cache
-rw-r--r-- 1 root root    0 Apr  6 12:36 .nix-channels
drwxr-xr-x 2 root root 4096 Apr  6 12:35 .nix-defexpr
lrwxrwxrwx 1 root root   29 Apr  6 12:33 .nix-profile -> /nix/var/nix/profiles/default
bash-4.4# ls /nix/var/nix/profiles/default
bin  etc  include  lib  libexec  manifest.nix  share
bash-4.4# nix-env -q
error: executing '': No such file or directory

zimbatm avatar Aug 14 '18 10:08 zimbatm

I found a Nix issue that might be related to this: https://github.com/NixOS/nix/issues/706

zimbatm avatar Aug 14 '18 11:08 zimbatm

@TerrorJack can you test the latest or circleci tag and let me know if it works for you? If it does I'll also push the 1-* tags

zimbatm avatar Aug 15 '18 13:08 zimbatm

@zimbatm The latest/circleci tags don't work, and PAGER doesn't seem to be set up.

λ  docker images -a
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
nixorg/nix                 latest              58f3bb037baf        6 weeks ago         249MB
nixorg/nix                 circleci            226a18c50ed6        2 months ago        248MB
docker4w/nsenter-dockerd   latest              cae870735e91        9 months ago        187kB

Did you push those tags?

TerrorJack avatar Aug 15 '18 14:08 TerrorJack

It looks like the builds have failed. Investigating https://hub.docker.com/r/nixorg/nix/builds/bsrbk7zqnn7bf7bcjb4boen/

zimbatm avatar Aug 15 '18 15:08 zimbatm

It looks like a transient error but it also seems to persist. It works fine locally so I pushed those images manually.

zimbatm avatar Aug 15 '18 15:08 zimbatm