summaryrefslogtreecommitdiffstats
path: root/vio/docker/build_image.sh
diff options
context:
space:
mode:
authorliangke <lokyse@163.com>2017-09-01 11:44:09 +0800
committerliangke <lokyse@163.com>2017-09-12 00:17:04 +0800
commit8c606e39936fc8676920c04bd08042b3ed7e82aa (patch)
tree5b58a613d3e4ac9239729a0c5cccbe59f52bdc5f /vio/docker/build_image.sh
parent4b94970eeb32c688d63542d0468130fb8d3953e9 (diff)
Multicloud VIO docker build files
Change-Id: I9e6188de471cd3ced174f65a31413bc1f7ee06d3 Issue-Id: MULTICLOUD-74 Signed-off-by: liangke <lokyse@163.com>
Diffstat (limited to 'vio/docker/build_image.sh')
-rwxr-xr-xvio/docker/build_image.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/vio/docker/build_image.sh b/vio/docker/build_image.sh
new file mode 100755
index 0000000..b1e691b
--- /dev/null
+++ b/vio/docker/build_image.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+DIRNAME=`dirname $0`
+DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+cd ${DOCKER_BUILD_DIR}
+
+BUILD_ARGS="--no-cache"
+ORG="onap"
+VERSION="1.0.0-SNAPSHOT"
+PROJECT="multicloud"
+IMAGE="vio"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
+IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
+
+if [ $HTTP_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
+
+function build_image {
+ echo "Start build docker image: ${IMAGE_NAME}"
+ docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
+}
+
+function push_image {
+ echo "Start push docker image: ${IMAGE_NAME}"
+ docker push ${IMAGE_NAME}:${VERSION}
+ docker push ${IMAGE_NAME}:latest
+}
+
+build_image
+push_image