summaryrefslogtreecommitdiff
path: root/hack/make-rules
diff options
context:
space:
mode:
authorShelley-BaoYue <baoyue2@huawei.com>2023-10-13 14:23:50 +0800
committerShelley-BaoYue <baoyue2@huawei.com>2023-10-13 15:06:12 +0800
commitd8885821a1976e28179aaaed71be75718d3f2b15 (patch)
tree7e5e91785f4ef011b078f8655715121e975b8b21 /hack/make-rules
parentMerge pull request #5047 from WillardHu/fix-upgradetime (diff)
downloadkubeedge-d8885821a1976e28179aaaed71be75718d3f2b15.tar.gz
reclaim space for docker
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
Diffstat (limited to 'hack/make-rules')
-rwxr-xr-xhack/make-rules/image.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/hack/make-rules/image.sh b/hack/make-rules/image.sh
index bbeea0219..eaf0e7341 100755
--- a/hack/make-rules/image.sh
+++ b/hack/make-rules/image.sh
@@ -40,7 +40,7 @@ ALL_IMAGES_AND_TARGETS=(
GO_LDFLAGS="$(${KUBEEDGE_ROOT}/hack/make-rules/version.sh)"
IMAGE_TAG=$(git describe --tags)
-
+DOCKER_BUILD_AND_SYSTEM_PRUNE=${DOCKER_BUILD_AND_SYSTEM_PRUNE:-"false"}
function get_imagename_by_target() {
local key=$1
@@ -90,6 +90,11 @@ function build_images() {
set -x
docker build --build-arg GO_LDFLAGS="${GO_LDFLAGS}" -t kubeedge/${IMAGE_NAME}:${IMAGE_TAG} -f ${DOCKERFILE_PATH} .
set +x
+
+ if [[ "${DOCKER_BUILD_AND_SYSTEM_PRUNE}" = "true" ]]; then
+ docker builder prune -f
+ docker system prune -f
+ fi
done
}