git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit8166bc934b254d61ea059f63764632fc2785d9da authorNick Spinale <nick@nickspinale.com> dateTue 10 Sep 2019, 23:02 (7 years ago) parent37e333a
1 file changed+4−3
pkgs/build-support/docker/default.nix+4−3
pkgs/build-support/docker/default.nix+4−3
@@ -1,4 +1,5 @@
11{
2+ buildPackages,
23 cacert,
34 callPackage,
45 closureInfo,
@@ -47,7 +48,7 @@ rec {
4748 , imageDigest
4849 , sha256
4950 , os ? "linux"
50− , arch ? "amd64"
51+ , arch ? buildPackages.go.GOARCH
5152
5253 # This is used to set name to the pulled image
5354 , finalImageName ? imageName
@@ -540,7 +541,7 @@ rec {
540541 configJson = let
541542 pure = writeText "${baseName}-config.json" (builtins.toJSON {
542543 inherit created config;
543− architecture = "amd64";
544+ architecture = buildPackages.go.GOARCH;
544545 os = "linux";
545546 });
546547 impure = runCommand "${baseName}-standard-dynamic-date.json"
@@ -658,7 +659,7 @@ rec {
658659 baseJson = let
659660 pure = writeText "${baseName}-config.json" (builtins.toJSON {
660661 inherit created config;
661− architecture = "amd64";
662+ architecture = buildPackages.go.GOARCH;
662663 os = "linux";
663664 });
664665 impure = runCommand "${baseName}-config.json"