Request: easy way to get resulting image name
tennox opened this issue · 2 comments
tennox commented
After
nix run .#dockerImage.copyToDockerDaemon
I want to run the image - I found this hacky way:
docker run (nix eval --impure --expr '(builtins.getFlake (toString ./.)).outputs.packages.x86_64-linux.dockerImage.imageRefUnsafe' --json | jq -r)
Could there be a simpler way? (or is there already?)
e.g. nix run .#dockerImage.printImageRef
💁♂️
tennox commented
I adapted my taskfile to just print the image ref to ./result
- so I can
docker run $(cat result)
But I guess that doesn't quite fit a nix run
cli 🤔 (and nix2container isn't really meant for nix build
, is it?)
tennox commented
Found that I can set:
nix2container.buildImage {
tag = "latest";
and then docker run image:latest
is this good practice? Not sure what other gotchas this might have 🤔