summaryrefslogtreecommitdiff
path: root/container.nix
diff options
context:
space:
mode:
Diffstat (limited to 'container.nix')
-rw-r--r--container.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/container.nix b/container.nix
new file mode 100644
index 0000000..3d25586
--- /dev/null
+++ b/container.nix
@@ -0,0 +1,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;
+}