Initial commit

This commit is contained in:
teutat3s 2023-10-31 23:11:45 +01:00
commit ed1e7dbbd7
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
3 changed files with 53 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

18
README.md Normal file
View 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
View 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" ];
};
}