Skip to content

Commit

Permalink
Fix Dockerfile builds FROM scratch
Browse files Browse the repository at this point in the history
This is a partial revert of 5412727

Do not abort the build when the base image is not found.

Signed-off-by: Vasiliy Ulyanov <vulyanov@suse.de>
  • Loading branch information
vasiliy-ul committed Aug 26, 2021
1 parent e57a5b6 commit c8d7081
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 c8d7081

Please sign in to comment.