Before: Manual push image to local docker hub. After: Auto push image to local docker hub, others can use the latest image after deploy.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- container/defconfig.sh | 10 ++++++++++ container/delimiter/build | 6 ++++++ 2 files changed, 16 insertions(+)
diff --git a/container/defconfig.sh b/container/defconfig.sh index 97d924d..4a5f5fa 100755 --- a/container/defconfig.sh +++ b/container/defconfig.sh @@ -31,3 +31,13 @@ set_es_indices() { find $CCI_SRC/sbin/ -name "es-*-mapping.sh" -exec sh {} ; } + +push_image() +{ + local local_docker_hub="$DOCKER_REGISTRY_HOST:$DOCKER_REGISTRY_PORT" + local src_tag=$1 + local dst_tag="$local_docker_hub/$src_tag" + + docker tag "$src_tag" "$dst_tag" + docker push "$dst_tag" +} diff --git a/container/delimiter/build b/container/delimiter/build index fc1af95..f7f53e7 100755 --- a/container/delimiter/build +++ b/container/delimiter/build @@ -2,4 +2,10 @@ # SPDX-License-Identifier: MulanPSL-2.0+ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+. ../defconfig.sh + +load_cci_defaults + docker build -t delimiter . + +push_image delimiter:latest