Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #54270 from xtruder/build-support/docker/layered_image_tag_passthru

dockerTools: buildLayeredImage passthru imageTag

authored by

lewo and committed by
GitHub
105ffa44 5ba532f9

+7 -2
+7 -2
pkgs/build-support/docker/default.nix
··· 544 544 buildInputs = [ jshon pigz coreutils findutils jq ]; 545 545 # Image name and tag must be lowercase 546 546 imageName = lib.toLower name; 547 - imageTag = if tag == null then "" else lib.toLower tag; 548 547 baseJson = configJson; 548 + passthru.imageTag = 549 + if tag == null 550 + then lib.head (lib.splitString "-" (lib.last (lib.splitString "/" result))) 551 + else lib.toLower tag; 549 552 } '' 550 - ${lib.optionalString (tag == null) '' 553 + ${if (tag == null) then '' 551 554 outName="$(basename "$out")" 552 555 outHash=$(echo "$outName" | cut -d - -f 1) 553 556 554 557 imageTag=$outHash 558 + '' else '' 559 + imageTag="${tag}" 555 560 ''} 556 561 557 562 find ${bulkLayers} -mindepth 1 -maxdepth 1 | sort -t/ -k5 -n > layer-list