Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7712acb90be7
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: da3516f69421
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 20, 2020

  1. dockerTools: Always cross compile for another arch in the cross example

    The example fails to build on aarch64, so lets cross build for gnu64.
    adisbladis committed Nov 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b7b22c5 View commit details
  2. Merge pull request #104374 from adisbladis/dockertools-cross-aarch64

    dockerTools: Always cross compile for another arch in the cross example
    adisbladis authored Nov 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    da3516f View commit details
Showing with 10 additions and 5 deletions.
  1. +3 −3 nixos/tests/docker-tools.nix
  2. +7 −2 pkgs/build-support/docker/examples.nix
6 changes: 3 additions & 3 deletions nixos/tests/docker-tools.nix
Original file line number Diff line number Diff line change
@@ -237,14 +237,14 @@ import ./make-test-python.nix ({ pkgs, ... }: {
with subtest("Ensure cross compiled image can be loaded and has correct arch."):
docker.succeed(
"docker load --input='${pkgs.dockerTools.examples.cross-aarch64}'",
"docker load --input='${pkgs.dockerTools.examples.cross}'",
)
assert (
docker.succeed(
"docker inspect ${pkgs.dockerTools.examples.cross-aarch64.imageName} "
"docker inspect ${pkgs.dockerTools.examples.cross.imageName} "
+ "| ${pkgs.jq}/bin/jq -r .[].Architecture"
).strip()
== "arm64v8"
== "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64v8"}"
)
'';
})
9 changes: 7 additions & 2 deletions pkgs/build-support/docker/examples.nix
Original file line number Diff line number Diff line change
@@ -408,10 +408,15 @@ rec {
};

# basic example, with cross compilation
cross-aarch64 = pkgsCross.aarch64-multiplatform.dockerTools.buildImage {
cross = let
# Cross compile for x86_64 if on aarch64
crossPkgs =
if pkgs.system == "aarch64-linux" then pkgsCross.gnu64
else pkgsCross.aarch64-multiplatform;
in crossPkgs.dockerTools.buildImage {
name = "hello-cross";
tag = "latest";
contents = pkgsCross.aarch64-multiplatform.hello;
contents = crossPkgs.hello;
};

}