summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-12-28 02:49:20 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-12-28 02:49:20 +0000
commitb58febe005c60bbd54fd069eecac707072fcdeeb (patch)
tree3d9578dcd2325d08b6f1b491358ae7abd5327345
parentc411e0a16b804792c1b34cc819618e1bfbca3d9a (diff)
parent20d22666aa841f0128b3f53a07ba0f31684537d8 (diff)
Merge "Clean base images only if 1 container was built"
-rw-r--r--build.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index f9a94652e..d1c964bdc 100644
--- a/build.sh
+++ b/build.sh
@@ -20,9 +20,9 @@ find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-
for dir in ${amd64_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:amd64-latest" .)
docker push "${repo}/functest-${dir##**/}:amd64-latest"
- [ "${dir}" != "docker/core" ] && docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true
+ [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true)
done
-docker rmi "${repo}/functest-core:amd64-latest" alpine:3.6 || true
+[ ! -z "${amd64_dirs}" ] && (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.6 || true)
find . -name Dockerfile -exec git checkout {} +
find . -name Dockerfile -exec sed -i -e "s|alpine:3.6|multiarch/alpine:arm64-v3.6|g" {} +
@@ -30,9 +30,9 @@ find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-
for dir in ${arm64_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:arm64-latest" .)
docker push "${repo}/functest-${dir##**/}:arm64-latest"
- [ "${dir}" != "docker/core" ] && docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true
+ [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true)
done
-docker rmi "${repo}/functest-core:arm64-latest" multiarch/alpine:arm64-v3.6 || true
+[ ! -z "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-latest" multiarch/alpine:arm64-v3.6 || true)
find . -name Dockerfile -exec git checkout {} +
exit $?