-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker.nix
More file actions
43 lines (37 loc) · 867 Bytes
/
docker.nix
File metadata and controls
43 lines (37 loc) · 867 Bytes
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
41
42
43
{ pkgs, ... }:
let
baseImage = pkgs.ociTools.pullImage {
imageName = "ubuntu";
tag = "latest";
};
in
pkgs.dockerTools.buildImage {
name = "imphnen-backend-service";
fromImage = baseImage;
copyToRoot = pkgs.buildEnv {
name = "imphnen-backend-service";
paths = [
(pkgs.stdenv.mkDerivation {
name = "imphnen-backend-service";
src = ./src;
buildInputs = [
pkgs.rustc
pkgs.cargo
pkgs.openssl
pkgs.pkg-config
];
buildPhase = ''
cargo build --release
'';
installPhase = ''
mkdir -p $out/bin
cp target/release/imphnen-backend-service $out/bin/
'';
})
];
};
config = {
Cmd = [ "/bin/imphnen-backend-service" ];
WorkingDir = "/bin";
};
}