I can use dockerTools buildImage or buildLayeredImage to build an image, and then import it to docker (docker load) or send it to a registry. But if I let nix generate the image tag automatically (from inputs I assume), I can’t access it. I’ve seen workarounds that parse the output from docker load (which prints the image name including tag to stdout), but that seems as that, a workaround.
Would it be possible to make the tag available in the return value of buildImage/buildLayeredImage? Eg. something like
let
image = dockerTools.buildLayeredImage { … }
tag = image.tag // <- the tag as generated by nix.