nixpkgs/nixos/tests/hocker-fetchdocker/machine.nix
Parnell Springmeyer c1eb962516
fetchdocker: Integration test exercising hocker and fetchdocker
This change adds a simple integration test exercising the fetchdocker
Nix code and hocker utilities for the simple `hello-world` docker
container. We exercise:

- Fetching the docker image configuration json
- Fetching the docker image layers
- Building a compositor script
- Loading the `hello-world` docker image into docker using the
  compositor script and `docker load`
- Running that loaded container
2017-12-01 21:06:16 -06:00

32 lines
833 B
Nix

{ config, pkgs, ... }:
{ nixpkgs.config.packageOverrides = pkgs': {
hello-world-container = pkgs'.callPackage ./hello-world-container.nix { };
haskellPackages = pkgs'.haskellPackages.override {
overrides = new: old: {
hocker = pkgs'.haskell.lib.dontCheck old.hocker;
};
};
};
virtualisation.docker = {
enable = true;
package = pkgs.docker;
};
systemd.services.docker-load-fetchdocker-image = {
description = "Docker load hello-world-container";
wantedBy = [ "multi-user.target" ];
wants = [ "docker.service" "local-fs.target" ];
after = [ "docker.service" "local-fs.target" ];
script = ''
${pkgs.hello-world-container}/compositeImage.sh | ${pkgs.docker}/bin/docker load
'';
serviceConfig = {
Type = "oneshot";
};
};
}