Skip to content

Commit

Permalink
Always use the version from the Dockerfile to construct the container…
Browse files Browse the repository at this point in the history
… filename

Commit 1a8b6a8 already used the version if
the name and version was defined. We now also use the version if the name
is not defined by using the repository part of the first tag as name.
  • Loading branch information
mlschroe committed May 23, 2024
1 parent 2a215d8 commit d090822
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build-recipe-docker
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ recipe_build_docker() {
mkdir -p $BUILD_ROOT$TOPDIR/DOCKER
FILENAME=$(perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::show -- "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" filename)
if test -z "$FILENAME" ; then
FILENAME="$FIRSTTAG"
# check if there is a version defined. if yes, keep the repository part and overwrite the tag
FILENAME=$(perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::show -- "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" version)
if test -n "$FILENAME" ; then
FILENAME="${FIRSTTAG%%:*}:$FILENAME"
else
FILENAME="$FIRSTTAG"
fi
fi
FILENAME="${FILENAME//[\/:]/-}"
test -n "$GOOS" -a "$GOOS" != "linux" && FILENAME="${FILENAME}_$GOOS"
Expand Down

0 comments on commit d090822

Please sign in to comment.