Skip to content

Commit 2c455d0

Browse files
committed
Cleanups docker images during and after build to fix disk usage issue.
1 parent c679050 commit 2c455d0

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

build_all.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ set -o pipefail
1616

1717
source ./common_functions.sh
1818

19-
# Cleanup any old containers and images
20-
cleanup_images
21-
2219
for ver in ${supported_versions}
2320
do
21+
# Cleanup any old containers and images
22+
cleanup_images
23+
cleanup_manifest
24+
2425
# Remove any temporary files
2526
rm -f hotspot_shasums_latest.sh openj9_shasums_latest.sh push_commands.sh
2627

@@ -66,3 +67,7 @@ do
6667
echo "test_tags" > ${test_image_types_file}
6768
./test_multiarch.sh ${ver}
6869
done
70+
71+
# Cleanup any old containers and images
72+
cleanup_images
73+
cleanup_manifest

common_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function cleanup_images() {
135135
docker rm $(docker ps -a | grep "Exited" | awk '{ print $1 }') 2>/dev/null
136136

137137
# Delete any old images for our target_repo on localhost.
138-
docker rmi -f $(docker images | grep -e "${target_repo}" | awk '{ print $3 }' | sort | uniq) 2>/dev/null
138+
docker rmi -f $(docker images | grep -e "adoptopenjdk" | awk '{ print $3 }' | sort | uniq) 2>/dev/null
139139
}
140140

141141
function cleanup_manifest() {

test_all.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ set -o pipefail
1616

1717
source ./common_functions.sh
1818

19-
# Cleanup any old containers and images
20-
cleanup_images
21-
2219
for ver in ${supported_versions}
2320
do
21+
# Cleanup any old containers and images
22+
cleanup_images
23+
cleanup_manifest
24+
2425
# Remove any temporary files
2526
rm -f hotspot_shasums_latest.sh openj9_shasums_latest.sh push_commands.sh manifest_commands.sh
2627

@@ -41,3 +42,7 @@ do
4142
exit 1;
4243
fi
4344
done
45+
46+
# Cleanup any old containers and images
47+
cleanup_images
48+
cleanup_manifest

update_manifest_all.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ set -o pipefail
1616

1717
source ./common_functions.sh
1818

19-
# Cleanup any old containers, images and manifest entries.
20-
cleanup_images
21-
cleanup_manifest
22-
2319
for ver in ${supported_versions}
2420
do
21+
# Cleanup any old containers, images and manifest entries.
22+
cleanup_images
23+
cleanup_manifest
24+
2525
# Remove any temporary files
2626
rm -f hotspot_shasums_latest.sh openj9_shasums_latest.sh manifest_commands.sh
2727

@@ -67,3 +67,7 @@ do
6767
cp ${test_image_types_all_file} ${test_image_types_file}
6868
./test_multiarch.sh ${ver}
6969
done
70+
71+
# Cleanup any old containers, images and manifest entries.
72+
cleanup_images
73+
cleanup_manifest

0 commit comments

Comments
 (0)