Build the image using Nix and load the result into Docker:
nix build
docker load < result
Now run the image:
docker run -t nix-docker-script:v0.1.0 foo bar baz
The output should be something like this:
Hello! Here's some information about this image:
{
built-by: aarch64-darwin,
built-for: x86_64-linux,
shell: /bin/bash,
base-image: shell-plus-coreutils
args-passed: "foo bar baz"
}
The built-by
field may change if you're using a different platform.
You can also build and run the image without having access to this code locally:
nix build 'github:the-nix-way/nix-docker-examples?dir=script'
docker load < result
docker run -t nix-docker-script:v0.1.0