From 8166bc934b254d61ea059f63764632fc2785d9da Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Tue, 10 Sep 2019 23:02:19 +0000 Subject: [PATCH] build-support/docker: set default image arch to host arch The architecture of an image should default to the architecture for which that image is being composed or pulled. buildPackages.go.GOARCH is an easy way to compute that architecture with the correct terminology. --- pkgs/build-support/docker/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 83e21c8945d..37b25232b96 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -1,4 +1,5 @@ { + buildPackages, cacert, callPackage, closureInfo, @@ -47,7 +48,7 @@ rec { , imageDigest , sha256 , os ? "linux" - , arch ? "amd64" + , arch ? buildPackages.go.GOARCH # This is used to set name to the pulled image , finalImageName ? imageName @@ -540,7 +541,7 @@ rec { configJson = let pure = writeText "${baseName}-config.json" (builtins.toJSON { inherit created config; - architecture = "amd64"; + architecture = buildPackages.go.GOARCH; os = "linux"; }); impure = runCommand "${baseName}-standard-dynamic-date.json" @@ -658,7 +659,7 @@ rec { baseJson = let pure = writeText "${baseName}-config.json" (builtins.toJSON { inherit created config; - architecture = "amd64"; + architecture = buildPackages.go.GOARCH; os = "linux"; }); impure = runCommand "${baseName}-config.json"