From c1f0d1978567ff02a07ad6c91647517024af1f09 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Tue, 26 Mar 2019 12:33:43 +0100 Subject: dockerTools: add nix-prefetch-docker script --- doc/functions/dockertools.xml | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'doc/functions') diff --git a/doc/functions/dockertools.xml b/doc/functions/dockertools.xml index 75db0bd3918..8330b977404 100644 --- a/doc/functions/dockertools.xml +++ b/doc/functions/dockertools.xml @@ -436,18 +436,7 @@ pullImage { imageDigest specifies the digest of the image to be - downloaded. Skopeo can be used to get the digest of an image, with its - inspect subcommand. Since a given - imageName may transparently refer to a manifest list of - images which support multiple architectures and/or operating systems, - supply the `--override-os` and `--override-arch` arguments to specify - exactly which image you want. By default it will match the OS and - architecture of the host the command is run on. - -$ nix-shell --packages skopeo jq --command "skopeo --override-os linux --override-arch x86_64 inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest'" -sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b - - This argument is required. + downloaded. This argument is required. @@ -477,6 +466,34 @@ sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b + + + nix-prefetch-docker command can be used to get required + image parameters: + + +$ nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5 + + + Since a given imageName may transparently refer to a + manifest list of images which support multiple architectures and/or + operating systems, you can supply the and + arguments to specify exactly which image you want. + By default it will match the OS and architecture of the host the command is + run on. + + +$ nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux + + + Desired image name and tag can be set using + and + arguments: + + +$ nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod + +
-- cgit 1.4.1