Skip to content

Commit

Permalink
Merge pull request #54270 from xtruder/build-support/docker/layered_i…
Browse files Browse the repository at this point in the history
…mage_tag_passthru

dockerTools: buildLayeredImage passthru imageTag
  • Loading branch information
nlewo committed Jan 20, 2019
2 parents 5ba532f + 1787afb commit 105ffa4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/build-support/docker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,19 @@ rec {
buildInputs = [ jshon pigz coreutils findutils jq ];
# Image name and tag must be lowercase
imageName = lib.toLower name;
imageTag = if tag == null then "" else lib.toLower tag;
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")"
outHash=$(echo "$outName" | cut -d - -f 1)
imageTag=$outHash
'' else ''
imageTag="${tag}"
''}
find ${bulkLayers} -mindepth 1 -maxdepth 1 | sort -t/ -k5 -n > layer-list
Expand Down

0 comments on commit 105ffa4

Please sign in to comment.