1 # This test runs a container through gvisor and checks if simple container starts
3 import ./make-test-python.nix ({ pkgs, ... }: {
5 meta = with pkgs.lib.maintainers; {
13 virtualisation.docker = {
15 extraOptions = "--add-runtime runsc=${pkgs.gvisor}/bin/runsc";
19 dhcpcd.enable = false;
20 defaultGateway = "192.168.1.1";
21 interfaces.eth1.ipv4.addresses = pkgs.lib.mkOverride 0 [
22 { address = "192.168.1.2"; prefixLength = 24; }
31 gvisor.wait_for_unit("network.target")
32 gvisor.wait_for_unit("sockets.target")
34 # Test the Docker runtime
35 gvisor.succeed("tar cv --files-from /dev/null | docker import - scratchimg")
37 "docker run -d --name=sleeping --runtime=runsc -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
39 gvisor.succeed("docker ps | grep sleeping")
40 gvisor.succeed("docker stop sleeping")