-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker.nix
41 lines (36 loc) · 1022 Bytes
/
docker.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs ? import <nixpkgs> { }
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
}:
let
beegenn = import ./default.nix;
in
# run the following:
# docker load $(nix-build docker.nix)
# This will avoid making another intermediate file...
pkgs.dockerTools.buildImage {
name = "beegenn";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = with pkgs; [
python310
busybox
beegenn
bashInteractive
# TODO: this does not work. propagatedBuildInputs does not work as I expected.
linuxPackages.nvidia_x11
cudatoolkit
] ++ beegenn.env.propagatedBuildInputs
#pathsToLink = ["/bin"]; # We need EVERYTHING
};
runAsRoot = ''
#!${pkgs.runtimeShell}
mkdir -p /out
'';
config = {
Cmd = [ "/bin/python" "-m" "beegenn" "simulation" "/out/data" "sim3" ];
# Cmd = ["/bin/python" "--version" ];
WorkingDir = "/out";
Volumes = { "/out" = { }; };
};
}