summary refs log tree commit diff
path: root/pkgs/build-support/docker
diff options
context:
space:
mode:
authorGraham Christensen <graham.christensen@target.com>2018-09-25 13:54:45 -0400
committerGraham Christensen <graham.christensen@target.com>2018-09-26 15:50:04 -0400
commit2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c (patch)
tree9a7590ce340654a610c3985d421df0d89c87b9e4 /pkgs/build-support/docker
parent725b57ba11e3e08c71cc4e754b63a72b512a88bd (diff)
downloadnixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar.gz
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar.bz2
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar.lz
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar.xz
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.tar.zst
nixpkgs-2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c.zip
dockertools: tarsum: turn in to a buildInput
Diffstat (limited to 'pkgs/build-support/docker')
-rw-r--r--pkgs/build-support/docker/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix
index 0cee1dd2916..6b5a06486e7 100644
--- a/pkgs/build-support/docker/default.nix
+++ b/pkgs/build-support/docker/default.nix
@@ -77,7 +77,9 @@ rec {
     ln -sT ${docker.src}/components/engine/pkg/tarsum src/github.com/docker/docker/pkg/tarsum
     go build
 
-    cp tarsum $out
+    mkdir -p $out/bin
+
+    cp tarsum $out/bin/
   '';
 
   # buildEnv creates symlinks to dirs, which is hard to edit inside the overlay VM
@@ -287,7 +289,7 @@ rec {
   }:
     runCommand "docker-layer-${name}" {
       inherit baseJson contents extraCommands;
-      buildInputs = [ jshon rsync ];
+      buildInputs = [ jshon rsync tarsum ];
     }
     ''
       mkdir layer
@@ -314,11 +316,11 @@ rec {
 
       # Compute a checksum of the tarball.
       echo "Computing layer checksum..."
-      tarsum=$(${tarsum} < $out/layer.tar)
+      tarhash=$(tarsum < $out/layer.tar)
 
       # Add a 'checksum' field to the JSON, with the value set to the
       # checksum of the tarball.
-      cat ${baseJson} | jshon -s "$tarsum" -i checksum > $out/json
+      cat ${baseJson} | jshon -s "$tarhash" -i checksum > $out/json
 
       # Indicate to docker that we're using schema version 1.0.
       echo -n "1.0" > $out/VERSION
@@ -402,8 +404,8 @@ rec {
 
         # Compute the tar checksum and add it to the output json.
         echo "Computing checksum..."
-        ts=$(${tarsum} < $out/layer.tar)
-        cat ${baseJson} | jshon -s "$ts" -i checksum > $out/json
+        tarhash=$(${tarsum}/bin/tarsum < $out/layer.tar)
+        cat ${baseJson} | jshon -s "$tarhash" -i checksum > $out/json
         # Indicate to docker that we're using schema version 1.0.
         echo -n "1.0" > $out/VERSION