-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
unable to install jdk in nixos/nix docker, selector 'jdk*' matches not derivations #133786
Comments
Could you provide the error message as well please? |
sure, will this suffice? + nix-env -i vim
installing 'vim-8.2.2567'
these paths will be fetched (7.61 MiB download, 35.88 MiB unpacked):
/nix/store/0dcf13hhk1kl9i0gcq7yjp8p9cp166n4-vim-8.2.2567
/nix/store/1838raw4b33pbry9m3c4mwrfigzbkf6r-gawk-5.1.0
copying path '/nix/store/1838raw4b33pbry9m3c4mwrfigzbkf6r-gawk-5.1.0' from 'https://cache.nixos.org'...
copying path '/nix/store/0dcf13hhk1kl9i0gcq7yjp8p9cp166n4-vim-8.2.2567' from 'https://cache.nixos.org'...
building '/nix/store/ra3vm69w7x99a3mzi0phpag8ib2877xd-user-environment.drv'...
created 430 symlinks in user environment
+ nix-env -i jdk8
error: selector 'jdk8' matches no derivations
FATAL: While performing build: while running engine: exit status 1 vim works nicely, but jdk8 fails. |
Means it can't find a package you called I'd recommend having a look at https://nixos.org/manual/nix/stable/#ch-basic-package-mgmt On NixOS:
on non-NixOS:
This is not an issue with nixpkgs. You can ask for more help on any Nix beginner channel, such as Discourse. 😉 |
yes, but jdk should be available both in Maybe the shell needs to be reinitialized as when using home-manager. I'll try to install it directly from the git archive in the evening and see if that works :-) I'll also post a follow up on Discourse when I have time. |
You can also use |
https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L11716 So I don't think this would solve the core issue. |
From https://nixos.org/manual/nixos/stable/#sec-ad-hoc-packages
In general, you are better off specifying |
Thanks a lot for looking into this @GuillaumeDesforges , it seems that: nix-env -iA nixos.jdk8` is not working for me inside the Docker container. Maybe after So I've found out that to get this to work inside RUN nix-env -f '<nixpkgs>' -iA jdk8 Sadly I do nix things more occasionally these days, so a bit rusty, should of course have thought to try this as well. |
I was sure I tested this approach earlier as well, nevertheless it works now: nix-env -iA nixpkgs.jdk8 |
On a note: I had not seen you were not on NixOS. Maybe just Btw if you are using dockerfile you can probably copy a Nix file with the proper package (or nix flake) and install from it, it'll relieve you of over complicated code in Dockerfile. Though this is an opinionated choice. |
Describe the bug
A clear and concise description of what the bug is.
Not able to install any jdk* version when using docker nixos
Steps To Reproduce
Steps to reproduce the behavior:
Create a docker file:
I also tried using openjdk instead of jdk, but that did also not work.
bash:
docker build -t .
Expected behavior
A clear and concise description of what you expected to happen.
jdk should install, I tried using other packages in the same way and they
install flawlessly.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
I now you can now do program.java=enable, but that only works in NixOS right?
The use of prefix like nixpkgs, nixos has always been confusing to me, so maybe I
did something wrong in this regard?
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information:
The text was updated successfully, but these errors were encountered: