From 7edea0ca4684676a096099313a50d018c00a111c Mon Sep 17 00:00:00 2001 From: yejianwu Date: Tue, 7 May 2019 15:05:29 +0800 Subject: [PATCH] add script to build and update images in registry server --- docker/update_images.sh | 28 ++++++++++++++++++++++++++++ docs/installation/using_docker.rst | 13 +++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 docker/update_images.sh diff --git a/docker/update_images.sh b/docker/update_images.sh new file mode 100755 index 00000000..1af9564e --- /dev/null +++ b/docker/update_images.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +BUILD_DIR_NAME="docker" +CURRENT_DIR_NAME=`basename "$PWD"` + +if [ $BUILD_DIR_NAME != $CURRENT_DIR_NAME ]; then + echo "You can run script only in 'mace/docker' directory" + exit 1 +fi + +# build images +docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite ./mace-dev-lite || exit 1 +docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev ./mace-dev-lite || exit 1 +docker build -t registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner ./gitlab-runner || exit 1 + +if grep -lq registry.cn-hangzhou.aliyuncs.com ~/.docker/config.json; then + # update images to repository + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite || exit 1 + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev || exit 1 + docker push registry.cn-hangzhou.aliyuncs.com/xiaomimace/gitlab-runner || exit 1 +else + echo "Login docker registry server is needed!" + exit 1 +fi + + diff --git a/docs/installation/using_docker.rst b/docs/installation/using_docker.rst index b0c5ac4e..bbfcf933 100644 --- a/docs/installation/using_docker.rst +++ b/docs/installation/using_docker.rst @@ -50,3 +50,16 @@ Create container with the following command registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite # Execute an interactive bash shell on the container docker exec -it mace-dev /bin/bash + + +Update images to repository +--------------------------- + +If you are mace inner developer and need update images in remote repository, +it can be achieved by `docker/update_images.sh` script. + +.. code:: sh + + cd docker/ + ./update_images.sh + -- GitLab