summaryrefslogtreecommitdiffstats
path: root/res/docker/instance_init.sh
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-04 15:37:05 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-09-04 15:37:05 +0800
commitdf054edf1951536181eeb7918ba9362471a19358 (patch)
treead4a25adb7a14e335eb45e7730581bc73d91c902 /res/docker/instance_init.sh
parent09c42913e057f4f0e5507e9c994827cd8af33f60 (diff)
Add vnfres docker build files
Add docker build files to build vfc gvnfm vnfres docker images. Change-Id: I8bc366de6d750bce627716c96f1feabb44a1c035 Issue-ID: VFC-255 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'res/docker/instance_init.sh')
-rw-r--r--res/docker/instance_init.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/res/docker/instance_init.sh b/res/docker/instance_init.sh
new file mode 100644
index 0000000..fd7c60f
--- /dev/null
+++ b/res/docker/instance_init.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+function install_python_libs {
+ cd /service/vfc/gvnfm/vnfres/res/
+ pip install -r requirements.txt
+}
+
+function start_redis_server {
+ redis-server &
+}
+
+function start_mysql {
+ su mysql -c /usr/bin/mysqld_safe &
+ 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 {
+ cd /service/vfc/gvnfm/vnfres/res/assembly/bin
+ bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1
+ cd /service
+}
+
+install_python_libs
+start_redis_server
+start_mysql
+create_database