From 3e51709307df43a1e7dfa51004371ffa083acf99 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 10 Jun 2022 11:33:05 +1000 Subject: [PATCH] containerfile: warn if we don't have a Dockerfile Currently if no Dockerfile is specified or found, we exit later with an obscure error. Check this after the element search; if we still don't have something to build then we can't continue. Change-Id: Ifb17a0995fab0ccfe7ee08363676c1fa57e37592 --- .../elements/containerfile/root.d/08-containerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/diskimage_builder/elements/containerfile/root.d/08-containerfile b/diskimage_builder/elements/containerfile/root.d/08-containerfile index 9bc961e2..7a852ad9 100755 --- a/diskimage_builder/elements/containerfile/root.d/08-containerfile +++ b/diskimage_builder/elements/containerfile/root.d/08-containerfile @@ -57,6 +57,11 @@ if [ -z "${DIB_CONTAINERFILE_DOCKERFILE:-}" ]; then done $_xtrace + + if [ -z "${DIB_CONTAINERFILE_DOCKERFILE:-}" ]; then + echo "*** DIB_CONTAINERFILE_DOCKERFILE not specified or found!" + exit 1 + fi fi # Use the image cache directory as the default context, so anything