Prerequisites:
- NixOS installed with docker
docker load --input $(nix-build -E 'with import <nixpkgs> {}; pkgs.dockerTools.buildLayeredImage { name = "cowsay-docker-oneliner"; tag = "latest"; contents = pkgs.cowsay; config = { Cmd = [ "/bin/cowsay" "Hello BusConf!" ]; }; }')
docker run --rm cowsay-docker-oneliner
nix-build cowsay-docker.nix
docker load < result
docker run --rm cowsay-nix
This example will build a docker image that runs the python script hello-busconf
with the help of:
hello-busconf.nix
- build the nix package, inclduing python dependencieshello-busconf.docker.nix
- build the docker imagedefault.nix
- build both
nix-build
docker load < result
docker run --rm hello-busconf-nix