diff options
| author | Shelley-BaoYue <baoyue2@huawei.com> | 2023-10-13 14:23:50 +0800 |
|---|---|---|
| committer | Shelley-BaoYue <baoyue2@huawei.com> | 2023-10-13 15:06:12 +0800 |
| commit | d8885821a1976e28179aaaed71be75718d3f2b15 (patch) | |
| tree | 7e5e91785f4ef011b078f8655715121e975b8b21 /hack/make-rules | |
| parent | Merge pull request #5047 from WillardHu/fix-upgradetime (diff) | |
| download | kubeedge-d8885821a1976e28179aaaed71be75718d3f2b15.tar.gz | |
reclaim space for docker
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
Diffstat (limited to 'hack/make-rules')
| -rwxr-xr-x | hack/make-rules/image.sh | 7 |
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 } |
