The smallest example is:
pkgs.dockerTools.buildLayeredImage { name = "hello"; contents = [ pkgs.hello ]; }