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