Skip to content

Commit

Permalink
Merge pull request #718 from vasiliy-ul/fix-dockerfile-builds-from-sc…
Browse files Browse the repository at this point in the history
…ratch

Fix Dockerfile builds FROM scratch
  • Loading branch information
adrianschroeter committed Sep 14, 2021
2 parents 49988dc + c8d7081 commit 0c56520
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build-recipe-docker
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ recipe_build_docker() {
touch $BUILD_ROOT/etc/resolv.conf

base_image_path=
base_image_tag=$(grep "^\s*FROM" "$RECIPEFILE" | head -n 1 | cut -d" " -f2)

base_image_path=$(find containers -regextype egrep -regex ".*\.(tgz|tar|tar\.xz|tar\.gz)$" -print -quit)
test -f "$base_image_path" || cleanup_and_exit 1 "base image not found"
if test "$base_image_tag" != scratch ; then
base_image_path=$(find containers -regextype egrep -regex ".*\.(tgz|tar|tar\.xz|tar\.gz)$" -print -quit)
test -f "$base_image_path" || cleanup_and_exit 1 "base image not found"
fi

mkdir -p "$BUILD_ROOT/$TOPDIR/SOURCES/repos"
if test "$BUILDENGINE" = podman; then
Expand Down

0 comments on commit 0c56520

Please sign in to comment.