From b6a9211bf4287aa6fdd505784a1cacc51cae0da5 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 17 Jan 2020 20:03:03 +0100 Subject: [PATCH] dockerTools.*: Assertion against building for darwin Building a docker image with darwin binaries just yields a confusing error when ran: standard_init_linux.go:211: exec user process caused "exec format error" This change prevents people from building such images in the first place --- pkgs/build-support/docker/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 3fcae13e20d7..c9457800ad27 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -589,6 +589,8 @@ rec { if tag == null then lib.head (lib.splitString "-" (lib.last (lib.splitString "/" result))) else lib.toLower tag; + # Docker can't be made to run darwin binaries + meta.badPlatforms = lib.platforms.darwin; } '' ${if (tag == null) then '' outName="$(basename "$out")" @@ -719,6 +721,8 @@ rec { layerClosure = writeReferencesToFile layer; passthru.buildArgs = args; passthru.layer = layer; + # Docker can't be made to run darwin binaries + meta.badPlatforms = lib.platforms.darwin; } '' ${lib.optionalString (tag == null) '' outName="$(basename "$out")"