Kitaab

Nix Docker

nix docker devops

published 2021-04-17 03:08

updated 2021-04-17 03:08

I can just use docker regularly on NixOS. That's pretty cool. I can use Nix to build docker images instead of a Dockerfile but that seems excessive.

{ pkgs ? import <nixpkgs> { system = "x86_64-linux"; } }:

pkgs.dockerTools.buildImage {
  name = "hello-docker";
  config = {
    Cmd = [ "${pkgs.hello}/bin/hello" ];
  };
}