mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
Merge pull request #54270 from xtruder/build-support/docker/layered_image_tag_passthru
dockerTools: buildLayeredImage passthru imageTag
This commit is contained in:
commit
105ffa445d
|
@ -544,14 +544,19 @@ rec {
|
||||||
buildInputs = [ jshon pigz coreutils findutils jq ];
|
buildInputs = [ jshon pigz coreutils findutils jq ];
|
||||||
# Image name and tag must be lowercase
|
# Image name and tag must be lowercase
|
||||||
imageName = lib.toLower name;
|
imageName = lib.toLower name;
|
||||||
imageTag = if tag == null then "" else lib.toLower tag;
|
|
||||||
baseJson = configJson;
|
baseJson = configJson;
|
||||||
|
passthru.imageTag =
|
||||||
|
if tag == null
|
||||||
|
then lib.head (lib.splitString "-" (lib.last (lib.splitString "/" result)))
|
||||||
|
else lib.toLower tag;
|
||||||
} ''
|
} ''
|
||||||
${lib.optionalString (tag == null) ''
|
${if (tag == null) then ''
|
||||||
outName="$(basename "$out")"
|
outName="$(basename "$out")"
|
||||||
outHash=$(echo "$outName" | cut -d - -f 1)
|
outHash=$(echo "$outName" | cut -d - -f 1)
|
||||||
|
|
||||||
imageTag=$outHash
|
imageTag=$outHash
|
||||||
|
'' else ''
|
||||||
|
imageTag="${tag}"
|
||||||
''}
|
''}
|
||||||
|
|
||||||
find ${bulkLayers} -mindepth 1 -maxdepth 1 | sort -t/ -k5 -n > layer-list
|
find ${bulkLayers} -mindepth 1 -maxdepth 1 | sort -t/ -k5 -n > layer-list
|
||||||
|
|
Loading…
Reference in a new issue