nix-community / docker-nix

Docker image for nix [maintainer=@zimbatm] [status=deprecated]
https://hub.docker.com/r/nixorg/nix/
Apache License 2.0
38 stars 9 forks source link

"nix-env -q" fails. #13

Open TerrorJack opened 6 years ago

TerrorJack commented 6 years ago

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
zimbatm commented 6 years ago

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

TerrorJack commented 6 years ago

@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?

zimbatm commented 6 years ago

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 commented 6 years ago

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

zimbatm commented 6 years ago

@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

TerrorJack commented 6 years ago

@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?

zimbatm commented 6 years ago

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

zimbatm commented 6 years ago

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