summaryrefslogtreecommitdiff
path: root/container.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-04-27 04:40:29 +0000
committerGitHub <[email protected]>2024-04-27 00:40:29 -0400
commita0a9cb51e35e915dbcc1d7bda430f45c4353c8ff (patch)
tree53041599823eddafbf464f1ddb5fcc0a95f63324 /container.nix
parentfbc60151f13d4529bea400f55c698dc1468eec46 (diff)
better compose overlay + add aarch64 support (#53)
* better compose overlay + add aarch64 support * ci: update workflows
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;
+}