summary refs log tree commit diff
path: root/doc/functions
diff options
context:
space:
mode:
authorJaka Hudoklin <offlinehacker@users.noreply.github.com>2019-04-06 14:44:19 +0200
committerGitHub <noreply@github.com>2019-04-06 14:44:19 +0200
commitc087b608e8b5abc9c142b7ed7666b1c9dc047820 (patch)
treec3a95a41a1ffff779d24eb954100f2f0d3ec023a /doc/functions
parentcfb6ade58c4731f36ade3baca5d6ddd6afd0095c (diff)
parentc1f0d1978567ff02a07ad6c91647517024af1f09 (diff)
downloadnixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar.gz
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar.bz2
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar.lz
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar.xz
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.tar.zst
nixpkgs-c087b608e8b5abc9c142b7ed7666b1c9dc047820.zip
Merge pull request #58360 from xtruder/pkgs/dockerTools/nix-prefetch-docker
dockerTools: add nix-prefetch-docker script
Diffstat (limited to 'doc/functions')
-rw-r--r--doc/functions/dockertools.xml41
1 files changed, 29 insertions, 12 deletions
diff --git a/doc/functions/dockertools.xml b/doc/functions/dockertools.xml
index cb32db74b42..e95ce1979de 100644
--- a/doc/functions/dockertools.xml
+++ b/doc/functions/dockertools.xml
@@ -437,18 +437,7 @@ pullImage {
    <callout arearefs='ex-dockerTools-pullImage-2'>
     <para>
      <varname>imageDigest</varname> specifies the digest of the image to be
-     downloaded. Skopeo can be used to get the digest of an image, with its
-     <varname>inspect</varname> subcommand. Since a given
-     <varname>imageName</varname> 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.
-<programlisting>
-$ 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
-</programlisting>
-     This argument is required.
+     downloaded. This argument is required.
     </para>
    </callout>
    <callout arearefs='ex-dockerTools-pullImage-3'>
@@ -486,6 +475,34 @@ sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b
     </para>
    </callout>
   </calloutlist>
+
+  <para>
+    <literal>nix-prefetch-docker</literal> command can be used to get required
+    image parameters:
+
+<programlisting>
+$ nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5
+</programlisting>
+
+    Since a given <varname>imageName</varname> may transparently refer to a
+    manifest list of images which support multiple architectures and/or
+    operating systems, you can supply the <option>--os</option> and
+    <option>--arch</option> 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.
+
+<programlisting>
+$ nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux
+</programlisting>
+
+    Desired image name and tag can be set using
+    <option>--final-image-name</option> and <option>--final-image-tag</option>
+    arguments:
+
+<programlisting>
+$ nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod
+</programlisting>
+  </para>
  </section>
 
  <section xml:id="ssec-pkgs-dockerTools-exportImage">