This is an automated email from the ASF dual-hosted git repository.

cmccabe pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 516c178  MINOR: Hint about "docker system prune" when ducker-ak build 
fails (#10995)
516c178 is described below

commit 516c178e31087059fd3162d43a0cef05d1ad1f5b
Author: Colin Patrick McCabe <[email protected]>
AuthorDate: Thu Jul 8 09:58:46 2021 -0700

    MINOR: Hint about "docker system prune" when ducker-ak build fails (#10995)
    
    Reviewers: Kamal Chandraprakash <[email protected]>, Jason 
Gustafson <[email protected]>
---
 tests/docker/ducker-ak | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/docker/ducker-ak b/tests/docker/ducker-ak
index e853548..fa9e657 100755
--- a/tests/docker/ducker-ak
+++ b/tests/docker/ducker-ak
@@ -173,6 +173,12 @@ must_popd() {
     popd &> /dev/null || die "failed to popd"
 }
 
+echo_and_do() {
+    local cmd="${@}"
+    echo "${cmd}"
+    ${cmd}
+}
+
 # Run a command and die if it fails.
 #
 # Optional flags:
@@ -225,7 +231,7 @@ ducker_build() {
     must_pushd "${ducker_dir}"
     # Tip: if you are scratching your head for some dependency problems that 
are referring to an old code version
     # (for example java.lang.NoClassDefFoundError), add --no-cache flag to the 
build shall give you a clean start.
-    must_do -v -o docker build --memory="${docker_build_memory_limit}" \
+    echo_and_do docker build --memory="${docker_build_memory_limit}" \
         --build-arg "ducker_creator=${user_name}" \
         --build-arg "jdk_version=${jdk_version}" \
         --build-arg "UID=${UID}" \
@@ -235,10 +241,13 @@ ducker_build() {
     must_popd
     duration="${SECONDS}"
     if [[ ${docker_status} -ne 0 ]]; then
-        die "** ERROR: Failed to build ${what} image after $((${duration} / 
60))m \
-$((${duration} % 60))s.  See ${build_log} for details."
+        echo "ERROR: Failed to build ${what} image after $((${duration} / 
60))m \
+$((${duration} % 60))s."
+        echo "If this error is unexpected, consider running 'docker system 
prune -a' \
+to clear old images from your local cache."
+        exit 1
     fi
-    echo "** Successfully built ${what} image in $((${duration} / 60))m \
+    echo "Successfully built ${what} image in $((${duration} / 60))m \
 $((${duration} % 60))s.  See ${build_log} for details."
 }
 

Reply via email to