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
This commit is contained in:
Silvan Mosberger 2020-01-17 20:03:03 +01:00
parent a1628d9805
commit b6a9211bf4
No known key found for this signature in database
GPG Key ID: E8F1E9EAD284E17D

View File

@ -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")"