summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2017-09-01 03:59:31 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-01 03:59:31 +0000
commitcb675c503a8afc69128f0e64ece08cd037522c75 (patch)
tree5b100a58736d2a84e85113a293ff094046665f8e
parentd209a6f402141b63426edcbeafbe2df7249d5194 (diff)
parentf9a1431adc1432921813263a8595eac577a09f17 (diff)
Merge "Update docker scripts"
-rwxr-xr-xdocker/build_image.sh14
-rwxr-xr-xdocker/instance_init.sh5
-rwxr-xr-xdocker/remove_image.sh6
-rwxr-xr-xdocker/run_image.sh2
4 files changed, 21 insertions, 6 deletions
diff --git a/docker/build_image.sh b/docker/build_image.sh
index 3c625248..508f0b41 100755
--- a/docker/build_image.sh
+++ b/docker/build_image.sh
@@ -2,6 +2,11 @@
MYSQL_ROOT_PASSWORD="root"
PROXY_ARGS=""
+ORG="onap"
+VERSION="1.0.0-SNAPSHOT"
+PROJECT="vfc"
+IMAGE="nslcm"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
if [ $HTTP_PROXY ]; then
PROXY_ARGS+="--build-arg HTTP_PROXY=${HTTP_PROXY}"
@@ -11,9 +16,14 @@ if [ $HTTPS_PROXY ]; then
fi
function build_lcm {
- cd ../
- docker build ${PROXY_ARGS} --build-arg MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -f docker/Dockerfile -t vfc-nfvo-lcm .
+ docker build ${PROXY_ARGS} --build-arg MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -t ${ORG}/${PROJECT}/${IMAGE}:${VERSION} -t ${ORG}/${PROJECT}/${IMAGE}:latest .
+}
+
+function push_lcm {
+ docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}:${VERSION}
+ docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}:latest
}
build_lcm
+push_lcm
docker image list
diff --git a/docker/instance_init.sh b/docker/instance_init.sh
index 255bbe24..f880c6bc 100755
--- a/docker/instance_init.sh
+++ b/docker/instance_init.sh
@@ -11,6 +11,11 @@ function start_redis_server {
function start_mysql {
service mysql start
+ # Wait for mysql to initialize; Set mysql root password
+ for i in {1..10}; do
+ sleep $i
+ bash /usr/bin/mysqladmin -u root password $MYSQL_ROOT_PASSWORD &> /dev/null && break
+ done
}
function create_database {
diff --git a/docker/remove_image.sh b/docker/remove_image.sh
index 962e95c8..e2d122f4 100755
--- a/docker/remove_image.sh
+++ b/docker/remove_image.sh
@@ -1,12 +1,12 @@
#!/bin/bash
function remove_lcm_container {
- docker container stop vfc-nfvo-lcm
- docker container rm vfc-nfvo-lcm
+ docker container stop vfc-nslcm
+ docker container rm vfc-nslcm
}
function remove_lcm_image {
- docker image rm vfc-nfvo-lcm
+ docker image rm vfc-nslcm
}
remove_lcm_container
diff --git a/docker/run_image.sh b/docker/run_image.sh
index b5a5b83e..5ee07d60 100755
--- a/docker/run_image.sh
+++ b/docker/run_image.sh
@@ -1,7 +1,7 @@
#!/bin/bash
function run_lcm {
- docker run -it --name vfc-nfvo-lcm -p 3306:3306 -p 8403:8403 vfc-nfvo-lcm
+ docker run -it --name vfc-nslcm -p 3306:3306 -p 8403:8403 onap/vfc/nslcm
}
run_lcm \ No newline at end of file