Merge "build-stx-base.sh --latest --clean fails to clean the latest image"

This commit is contained in:
Zuul 2018-12-21 19:24:46 +00:00 committed by Gerrit Code Review
commit f99c48ad0b
1 changed files with 9 additions and 0 deletions

View File

@ -249,6 +249,15 @@ if [ "${CLEAN}" = "yes" ]; then
exit 1
fi
if [ "$TAG_LATEST" = "yes" ]; then
echo "Deleting image: ${IMAGE_NAME_LATEST}"
docker image rm ${IMAGE_NAME_LATEST}
if [ $? -ne 0 ]; then
echo "Failed running docker image rm command" >&2
exit 1
fi
fi
if [ ${BASE_IMAGE_PRESENT} -ne 0 ]; then
# The base image was not already present, so delete it
echo "Removing docker image ${OS}:${OS_VERSION}"