diff options
author | lewo <lewo@abesis.fr> | 2019-06-08 09:01:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-08 09:01:11 +0200 |
commit | 0e28092a561f9e9620da8c1013e3baab5df38b03 (patch) | |
tree | 584e1bc63b5e46e6feec487da7b9ea787975b825 /nixos | |
parent | bfa0e4345e6b08024b7235850e51c3e34f8922cd (diff) | |
parent | 3b0d5b5ed3815d3bf5cf1c85a6c8e17091ba7258 (diff) |
Merge pull request #62773 from danieldk/docker-shared-layer-test
nixos/tests/docker-tools: check layer sharing with buildLayeredImage
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/docker-tools.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index f91121077ea5..9ab1a71f3314 100644 --- a/nixos/tests/docker-tools.nix +++ b/nixos/tests/docker-tools.nix @@ -68,6 +68,12 @@ import ./make-test.nix ({ pkgs, ... }: { $docker->succeed("docker load --input='${pkgs.dockerTools.examples.layered-on-top}'"); $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.layered-on-top.imageName}"); + # Ensure layers are shared between images + $docker->succeed("docker load --input='${pkgs.dockerTools.examples.another-layered-image}'"); + $docker->succeed("docker inspect ${pkgs.dockerTools.examples.layered-image.imageName} | ${pkgs.jq}/bin/jq -r '.[] | .RootFS.Layers | .[]' | sort > layers1.sha256"); + $docker->succeed("docker inspect ${pkgs.dockerTools.examples.another-layered-image.imageName} | ${pkgs.jq}/bin/jq -r '.[] | .RootFS.Layers | .[]' | sort > layers2.sha256"); + $docker->succeed('[ $(comm -1 -2 layers1.sha256 layers2.sha256 | wc -l) -ne 0 ]'); + # Ensure order of layers is correct $docker->succeed("docker load --input='${pkgs.dockerTools.examples.layersOrder}'"); $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.layersOrder.imageName} cat /tmp/layer1 | grep -q layer1"); |