diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-02 10:20:09 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-02 10:20:09 +0800 |
commit | f2580f8d27468047c199f921728548e815a89d94 (patch) | |
tree | f6cd3fe0679a57251eb21a9e9ee98d41af095e5f | |
parent | a4e6240ba6dfa31d6bcc632b844045e53078b099 (diff) |
Fix docker file of vfc-gvnfm-vnflcm
Change-Id: I10f06209ed3a52e394d7088849dcf4754d674f4c
Issue-Id: VFC-236
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rwxr-xr-x | lcm/docker/Dockerfile | 18 | ||||
-rwxr-xr-x | lcm/docker/docker-entrypoint.sh | 6 | ||||
-rwxr-xr-x | lcm/docker/instance_config.sh | 22 | ||||
-rwxr-xr-x | lcm/docker/instance_init.sh | 1 | ||||
-rwxr-xr-x | lcm/docker/instance_run.sh | 1 |
5 files changed, 26 insertions, 22 deletions
diff --git a/lcm/docker/Dockerfile b/lcm/docker/Dockerfile index 5b847db3..7b236981 100755 --- a/lcm/docker/Dockerfile +++ b/lcm/docker/Dockerfile @@ -2,29 +2,30 @@ FROM ubuntu:14.04 ARG HTTP_PROXY=${HTTP_PROXY} ARG HTTPS_PROXY=${HTTPS_PROXY} -ARG MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} ENV http_proxy $HTTP_PROXY ENV https_proxy $HTTPS_PROXY -ENV MYSQL_ROOT_PASSWORD $MYSQL_ROOT_PASSWORD + +RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections +RUN echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections RUN apt-get update && \ - apt-get install -y python-devel && \ apt-get install -y python-virtualenv && \ apt-get install -y python-setuptools && \ apt-get install -y python-dev && \ apt-get install -y python-pip && \ - apt-get install -y openssl-devel && \ - apt-get install -y mysql-devel && \ apt-get install -y gcc && \ - apt-get install -y libffi-devel && \ - apt-get install -y redis && \ apt-get install -y libmysqlclient-dev && \ apt-get install -y redis-server && \ apt-get install -y mysql-server && \ apt-get install -y mysql-client && \ apt-get install -y wget && \ - apt-get install -y unzip + apt-get install -y unzip && \ + apt-get install -y curl && \ + apt-get install -y build-essential && \ + apt-get install -y libssl-dev && \ + apt-get install -y libffi-dev && \ + yes | pip install cryptography ADD . /service WORKDIR /service @@ -43,6 +44,7 @@ RUN wget -q -O vfc-gvnfm-vnfres-res.zip 'https://nexus.onap.org/service/local/ar EXPOSE 8801 EXPOSE 3306 +EXPOSE 6379 WORKDIR /service ENTRYPOINT vfc/gvnfm/vnflcm/lcm/docker/docker-entrypoint.sh diff --git a/lcm/docker/docker-entrypoint.sh b/lcm/docker/docker-entrypoint.sh index 90341e83..2c6a8c07 100755 --- a/lcm/docker/docker-entrypoint.sh +++ b/lcm/docker/docker-entrypoint.sh @@ -24,12 +24,12 @@ for i in {1..20}; do done # Configure service based on docker environment variables -./instance-config.sh +vfc/gvnfm/vnflcm/lcm/docker/instance_config.sh # microservice-specific one-time initialization -./instance-init.sh +vfc/gvnfm/vnflcm/lcm/docker/instance_init.sh date > init.log # Start the microservice -./instance-run.sh +vfc/gvnfm/vnflcm/lcm/docker/instance_run.sh diff --git a/lcm/docker/instance_config.sh b/lcm/docker/instance_config.sh index d3501b45..508fa006 100755 --- a/lcm/docker/instance_config.sh +++ b/lcm/docker/instance_config.sh @@ -3,12 +3,12 @@ MSB_IP=`echo $MSB_ADDR | cut -d: -f 1` MSB_PORT=`echo $MSB_ADDR | cut -d: -f 2` -sed -i "s|MSB_SERVICE_IP.*|MSB_SERVICE_IP = '$MSB_IP'|" lcm/lcm/pub/config/config.py -sed -i "s|MSB_SERVICE_PORT.*|MSB_SERVICE_PORT = '$MSB_PORT'|" lcm/lcm/pub/config/config.py -sed -i "s|DB_NAME.*|DB_NAME = 'gvnfm'|" lcm/lcm/pub/config/config.py -sed -i "s|DB_USER.*|DB_USER = 'gvnfm'|" lcm/lcm/pub/config/config.py -sed -i "s|DB_PASSWD.*|DB_PASSWD = 'gvnfm'|" lcm/lcm/pub/config/config.py -sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" lcm/lcm/pub/config/config.py +sed -i "s|MSB_SERVICE_IP.*|MSB_SERVICE_IP = '$MSB_IP'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|MSB_SERVICE_PORT.*|MSB_SERVICE_PORT = '$MSB_PORT'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|DB_NAME.*|DB_NAME = 'gvnfm'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|DB_USER.*|DB_USER = 'gvnfm'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|DB_PASSWD.*|DB_PASSWD = 'gvnfm'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|\"ip\": \".*\"|\"ip\": \"$SERVICE_IP\"|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py # Configure MYSQL if [ -z "$MYSQL_ADDR" ]; then @@ -20,10 +20,10 @@ else MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2` fi echo "MYSQL_ADDR=$MYSQL_ADDR" -sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" lcm/lcm/pub/config/config.py -sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" lcm/lcm/pub/config/config.py +sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py +sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py -cat lcm/lcm/pub/config/config.py +cat vfc/gvnfm/vnflcm/lcm/lcm/pub/config/config.py -sed -i "s|127\.0\.0\.1|$SERVICE_IP|" lcm/run.sh -sed -i "s|127\.0\.0\.1|$SERVICE_IP|" lcm/stop.sh +sed -i "s|127\.0\.0\.1|$SERVICE_IP|" vfc/gvnfm/vnflcm/lcm/run.sh +sed -i "s|127\.0\.0\.1|$SERVICE_IP|" vfc/gvnfm/vnflcm/lcm/stop.sh diff --git a/lcm/docker/instance_init.sh b/lcm/docker/instance_init.sh index f33294db..d727efe3 100755 --- a/lcm/docker/instance_init.sh +++ b/lcm/docker/instance_init.sh @@ -21,6 +21,7 @@ function start_mysql { function create_database { cd /service/bin bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1 + cd /service } install_python_libs diff --git a/lcm/docker/instance_run.sh b/lcm/docker/instance_run.sh index 76f40163..d8beee56 100755 --- a/lcm/docker/instance_run.sh +++ b/lcm/docker/instance_run.sh @@ -1,5 +1,6 @@ #!/bin/bash cd /service/vfc/gvnfm/vnflcm/lcm +chmod +x run.sh ./run.sh while [ ! -f logs/gvnfm_vnflcm.log ]; do |