summaryrefslogtreecommitdiff
path: root/container.nix
blob: 3d25586fbc01326c0a9f283bff36527459fa4341 (plain)
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
{
  lib,
  buildEnv,
  dockerTools,
  runCommand,
  bashInteractive,
  workerd,
}:
dockerTools.buildLayeredImage {
  name = workerd.pname;
  tag = "latest";

  contents = [
    (buildEnv {
      name = "image-root";
      paths = [
        (runCommand "bin-sh" {} ''
          mkdir -p $out/bin
          ln -s ${lib.getExe bashInteractive} $out/bin/sh
        '')
        workerd
      ];
      pathsToLink = ["/bin" "/etc"];
    })
    dockerTools.caCertificates
  ];

  config.Cmd = [(lib.getExe workerd)];
  architecture = workerd.stdenv.hostPlatform.ubootArch;
}