Initial commit
This commit is contained in:
commit
ed1e7dbbd7
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
result
|
18
README.md
Normal file
18
README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
# nix-flakes-node docker image
|
||||
|
||||
How to build:
|
||||
```
|
||||
docker load --input $(nix-build default.nix)
|
||||
```
|
||||
|
||||
How to test:
|
||||
```
|
||||
docker tag nix-flakes-node:ghyn1438kgxp09pxlpg6xakyw2fkjyhi nix-flakes-node:latest
|
||||
docker run -it --rm nix-flakes-node:latest bash
|
||||
|
||||
bash-5.2# node
|
||||
|
||||
Welcome to Node.js v20.5.1.
|
||||
Type ".help" for more information.
|
||||
>
|
||||
```
|
34
default.nix
Normal file
34
default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs ? import <nixpkgs> { }
|
||||
|
||||
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
|
||||
|
||||
}:
|
||||
let
|
||||
nixFlakesImage = pkgs.dockerTools.pullImage {
|
||||
imageName = "docker.nix-community.org/nixpkgs/nix-flakes";
|
||||
imageDigest = "sha256:c564622ed14cccc8c5faa93d2540da29101200f41c442c824da83f54d4915a40";
|
||||
sha256 = "15zkpmcrzqplz3fyi5z3gbjag19k627lszdvl93i2rb3ajkbvch6";
|
||||
finalImageName = "docker.nix-community.org/nixpkgs/nix-flakes";
|
||||
finalImageTag = "latest";
|
||||
os = "linux";
|
||||
arch = "x86_64";
|
||||
};
|
||||
in
|
||||
|
||||
pkgs.dockerTools.buildImage {
|
||||
|
||||
name = "nix-flakes-node";
|
||||
|
||||
fromImage = nixFlakesImage;
|
||||
fromImageTag = "latest";
|
||||
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
paths = [ pkgsLinux.nodejs_20 ];
|
||||
pathsToLink = [ "/bin" ];
|
||||
};
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/bash" ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue