at 23.05-pre 1.1 kB view raw
1# this test creates a simple GNU image with docker tools and sees if it executes 2 3import ./make-test-python.nix ({ pkgs, ... }: 4{ 5 name = "docker-tools-overlay"; 6 meta = with pkgs.lib.maintainers; { 7 maintainers = [ lnl7 roberth ]; 8 }; 9 10 nodes = { 11 docker = 12 { ... }: 13 { 14 virtualisation.docker.enable = true; 15 virtualisation.docker.storageDriver = "overlay"; # defaults to overlay2 16 }; 17 }; 18 19 testScript = '' 20 docker.wait_for_unit("sockets.target") 21 22 docker.succeed( 23 "docker load --input='${pkgs.dockerTools.examples.bash}'", 24 "docker run --rm ${pkgs.dockerTools.examples.bash.imageName} bash --version", 25 ) 26 27 # Check if the nix store has correct user permissions depending on what 28 # storage driver is used, incorrectly built images can show up as readonly. 29 # drw------- 3 0 0 3 Apr 14 11:36 /nix 30 # drw------- 99 0 0 100 Apr 14 11:36 /nix/store 31 docker.succeed("docker run --rm -u 1000:1000 ${pkgs.dockerTools.examples.bash.imageName} bash --version") 32 ''; 33})