From 3ed7ed54874b3ddcfdee2da72a86051b8dc3953a Mon Sep 17 00:00:00 2001 From: Wenda Date: Fri, 25 May 2018 04:55:37 +0000 Subject: [PATCH] Tag the newly built docker as remote latest and push to the remote registry Signed-off-by: Wenda --- push_docker.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/push_docker.sh b/push_docker.sh index 3ba9abfae5bf..33c20cc2f6e1 100755 --- a/push_docker.sh +++ b/push_docker.sh @@ -20,11 +20,13 @@ remote_image_name=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:$DOCKER_IMA timestamp="$(date -u +%Y%m%d)" build_version="${timestamp}.bld-${BUILD_NUMBER}" build_remote_image_name=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:$build_version +remote_image_name_latest=$REGISTRY_SERVER:$REGISTRY_PORT/$docker_image_name:latest ## Add registry information as tag, so will push as latest ## Add additional tag with build information docker tag $docker_image_name $remote_image_name docker tag $docker_image_name $build_remote_image_name +docker tag $docker_image_name $remote_image_name_latest ## Login the docker image registry server ## Note: user name and password are passed from command line @@ -39,4 +41,6 @@ echo "Image sha256: $image_sha" echo "Pushing $build_remote_image_name" docker push $build_remote_image_name docker rmi $build_remote_image_name || true +docker push $remote_image_name_latest +docker rmi $remote_image_name_latest || true docker rmi $docker_image_name || true