dockerTools: normalize arch to GOARCH
Docker (via containerd) and the the OCI Image Configuration imply and suggest, respectfully, that the architecture set in images matches those of GOARCH in the Go Language document. This changeset updates the implimentation of getArch in dockerTools to return GOARCH values, to satisfy Docker. Fixes: #106695
This commit is contained in:
parent
46e2a315ad
commit
8f66dc94a7
|
@ -245,7 +245,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||||
"docker inspect ${pkgs.dockerTools.examples.cross.imageName} "
|
"docker inspect ${pkgs.dockerTools.examples.cross.imageName} "
|
||||||
+ "| ${pkgs.jq}/bin/jq -r .[].Architecture"
|
+ "| ${pkgs.jq}/bin/jq -r .[].Architecture"
|
||||||
).strip()
|
).strip()
|
||||||
== "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64v8"}"
|
== "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64"}"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
@ -58,15 +58,15 @@ let
|
||||||
done;
|
done;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Map nixpkgs architecture to Docker notation
|
# Map nixpkgs architecture to OCI recomendation
|
||||||
# Reference: https://github.com/docker-library/official-images#architectures-other-than-amd64
|
# Reference: https://github.com/opencontainers/image-spec/blob/master/config.md#properties
|
||||||
getArch = nixSystem: {
|
getArch = nixSystem: {
|
||||||
aarch64-linux = "arm64v8";
|
aarch64-linux = "arm64";
|
||||||
armv7l-linux = "arm32v7";
|
armv7l-linux = "arm";
|
||||||
x86_64-linux = "amd64";
|
x86_64-linux = "amd64";
|
||||||
powerpc64le-linux = "ppc64le";
|
powerpc64le-linux = "ppc64le";
|
||||||
i686-linux = "i386";
|
i686-linux = "386";
|
||||||
}.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture notation. Please check that your input and your requested build are correct or update the mapping in Nixpkgs.";
|
}.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture. Please check that your input and your requested build are correct or update the mapping in Nixpkgs.";
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
|
|
Loading…
Reference in a new issue