From d35dcb12804700c15fb398e1dce6ad8d5995929c Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Mon, 9 Apr 2018 14:52:41 +0200 Subject: dockerTools.pullImage: documentation and release note --- doc/functions.xml | 55 +++++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'doc/functions.xml') diff --git a/doc/functions.xml b/doc/functions.xml index 155ea2bd0043..cdae96703f13 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -624,10 +624,9 @@ merge:"diff3" This function is analogous to the docker pull command, - in that can be used to fetch a Docker image from a Docker registry. - Currently only registry v1 is supported. By default - Docker Hub is used to - pull images. + in that can be used to pull a Docker image from a Docker registry. + By default Docker Hub + is used to pull images. @@ -638,13 +637,10 @@ merge:"diff3" Docker pull pullImage { - imageName = "debian"; - imageTag = "jessie"; - imageId = null; - sha256 = "1bhw5hkz6chrnrih0ymjbmn69hyfriza2lr550xyvpdrnbzr4gk2"; - - indexUrl = "https://index.docker.io"; - registryVersion = "v1"; + imageName = "nixos/nix"; + imageDigest = "sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b"; + finalImageTag = "1.11"; + sha256 = "0mqjy3zq2v6rrhizgb9nvhczl87lcfphq9601wcprdika2jz7qh8"; } @@ -652,24 +648,28 @@ merge:"diff3" - imageName specifies the name of the image to be - downloaded, which can also include the registry namespace (e.g. - library/debian). This argument is required. + imageName specifies the name of the image to be downloaded, + which can also include the registry namespace (e.g. nixos). + This argument is required. - imageTag specifies the tag of the image to be - downloaded. By default it's latest. + imageDigest specifies the digest of the image + to be downloaded. Skopeo can be used to get the digest of an image + + $ skopeo inspect docker://docker.io/nixos/nix:1.11 | jq -r '.Digest' + sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b + + This argument is required. - imageId, if specified this exact image will be - fetched, instead of imageName/imageTag. However, the - resulting repository will still be named - imageName/imageTag. By default it's - null. + finalImageTag, if specified, this is the tag of + the image to be created. Note it is never used to fetch the image + since we prefer to rely on the immutable digest ID. By default + it's latest. @@ -677,19 +677,6 @@ merge:"diff3" sha256 is the checksum of the whole fetched image. This argument is required. - - - The checksum is computed on the unpacked directory, not on the final - tarball. - - - - - - In the above example the default values are shown for the variables - indexUrl and registryVersion. Hence - by default the Docker.io registry is used to pull the images. - -- cgit v1.2.3