mirror of
https://github.com/goharbor/harbor
synced 2024-09-21 04:35:33 +00:00
Remove local goharbor images after building
Local images should be removed since images have been pushed to docker hub. Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
8bb3e1d084
commit
bdc2285cde
3
.github/workflows/build-package.yml
vendored
3
.github/workflows/build-package.yml
vendored
|
@ -91,8 +91,7 @@ jobs:
|
|||
else
|
||||
Harbor_Build_Base_Tag=dev
|
||||
fi
|
||||
sudo docker rmi -f $(docker images -a -q)
|
||||
sudo docker system prune -a -f
|
||||
|
||||
cd src/github.com/goharbor/harbor
|
||||
sudo make package_offline GOBUILDTAGS="include_oss include_gcs" BASEIMAGETAG=${Harbor_Build_Base_Tag} VERSIONTAG=${Harbor_Assets_Version} PKGVERSIONTAG=${Harbor_Package_Version} BUILDBIN=true NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true TRIVYFLAG=true HTTPPROXY=
|
||||
sudo make package_online GOBUILDTAGS="include_oss include_gcs" BASEIMAGETAG=${Harbor_Build_Base_Tag} VERSIONTAG=${Harbor_Assets_Version} PKGVERSIONTAG=${Harbor_Package_Version} BUILDBIN=true NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true TRIVYFLAG=true HTTPPROXY=
|
||||
|
|
|
@ -112,3 +112,16 @@ if [ $? -ne 0 ];then
|
|||
else
|
||||
success "Pushing image $IMAGE succeeded";
|
||||
fi
|
||||
|
||||
h2 "Remove local goharbor images"
|
||||
DOCKER_RMI="docker rmi $(docker images | grep "goharbor" | awk '{print $3}') -f"
|
||||
info "$DOCKER_RMI"
|
||||
DOCKER_RMI_OUTPUT=$($DOCKER_RMI)
|
||||
|
||||
if [ $? -ne 0 ];then
|
||||
warn $DOCKER_RMI_OUTPUT
|
||||
error "Clean local goharbor images failed";
|
||||
else
|
||||
success "Clean local goharbor images succeeded";
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user