dockerTools: Add cross example

This commit is contained in:
adisbladis 2020-11-19 17:31:38 +01:00
parent 8a3b33baed
commit 5357abf49a
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -7,7 +7,7 @@
# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
# $ docker load < result
{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb }:
{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb, pkgsCross }:
rec {
# 1. basic example
@ -407,4 +407,11 @@ rec {
contents = [ pkgs.bash pkgs.coreutils ] ++ nonRootShadowSetup { uid = 999; user = "somebody"; };
};
# basic example, with cross compilation
cross-aarch64 = pkgsCross.aarch64-multiplatform.dockerTools.buildImage {
name = "hello-cross";
tag = "latest";
contents = pkgsCross.aarch64-multiplatform.hello;
};
}