forked from kadena-io/chainweb-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.nix
40 lines (35 loc) · 1.1 KB
/
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
{ kpkgs ? import ./deps/kpkgs {}
, chainweb-data ? import ./. {}
, dockerTag ? "latest"
, rev ? "a7ecde854aee5c4c7cd6177f54a99d2c1ff28a31"
, sha256 ? "162dywda2dvfj1248afxc45kcrg83appjd0nmdb541hl7rnncf02"
, pkgs ?
import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
}) {
config.allowBroken = false;
config.allowUnfree = true;
}
, baseImage ? pkgs.dockerTools.pullImage {
imageName = "ubuntu";
imageDigest = "sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea";
sha256 = "10wlr8rhiwxmz1hk95s9vhkrrjkzyvrv6nshg23j86rw08ckrqnz";
finalImageTag = "22.04";
finalImageName = "ubuntu";
}
, ... }:
pkgs.dockerTools.buildImage {
name = "chainweb-data";
tag = dockerTag;
fromImage = baseImage;
runAsRoot = ''
ln -s "${pkgs.haskell.lib.justStaticExecutables chainweb-data}/bin/chainweb-data" /usr/local/bin/
mkdir -p /chainweb-data
'';
config = {
WorkingDir = "/chainweb-data";
Volumes = { "/chainweb-data" = {}; };
Entrypoint = [ "chainweb-data" ];
};
}