git.iko.soy/typeable/nixpkgs
on master help sign in
dockertools: tarsum: turn in to a buildInput
commit2bf0ee3b2b47562a31e8d9f9c8fe903f67dbfe5c authorGraham Christensen <graham.christensen@target.com> dateTue 25 Sep 2018, 13:54 (8 years ago) parent725b57b
1 file changed+8−6
pkgs/build-support/docker/default.nix+8−6
pkgs/build-support/docker/default.nix+8−6
@@ -77,7 +77,9 @@ rec {
7777 ln -sT ${docker.src}/components/engine/pkg/tarsum src/github.com/docker/docker/pkg/tarsum
7878 go build
7979
80− cp tarsum $out
80+ mkdir -p $out/bin
81+
82+ cp tarsum $out/bin/
8183 '';
8284
8385 # buildEnv creates symlinks to dirs, which is hard to edit inside the overlay VM
@@ -287,7 +289,7 @@ rec {
287289 }:
288290 runCommand "docker-layer-${name}" {
289291 inherit baseJson contents extraCommands;
290− buildInputs = [ jshon rsync ];
292+ buildInputs = [ jshon rsync tarsum ];
291293 }
292294 ''
293295 mkdir layer
@@ -314,11 +316,11 @@ rec {
314316
315317 # Compute a checksum of the tarball.
316318 echo "Computing layer checksum..."
317− tarsum=$(${tarsum} < $out/layer.tar)
319+ tarhash=$(tarsum < $out/layer.tar)
318320
319321 # Add a 'checksum' field to the JSON, with the value set to the
320322 # checksum of the tarball.
321− cat ${baseJson} | jshon -s "$tarsum" -i checksum > $out/json
323+ cat ${baseJson} | jshon -s "$tarhash" -i checksum > $out/json
322324
323325 # Indicate to docker that we're using schema version 1.0.
324326 echo -n "1.0" > $out/VERSION
@@ -402,8 +404,8 @@ rec {
402404
403405 # Compute the tar checksum and add it to the output json.
404406 echo "Computing checksum..."
405− ts=$(${tarsum} < $out/layer.tar)
406− cat ${baseJson} | jshon -s "$ts" -i checksum > $out/json
407+ tarhash=$(${tarsum}/bin/tarsum < $out/layer.tar)
408+ cat ${baseJson} | jshon -s "$tarhash" -i checksum > $out/json
407409 # Indicate to docker that we're using schema version 1.0.
408410 echo -n "1.0" > $out/VERSION
409411