From a1b865c98638224ff18f8a673f2a7a2ca875934d Mon Sep 17 00:00:00 2001 From: yangyan Date: Wed, 17 Apr 2019 15:51:14 +0800 Subject: Modify catalog docker file Change-Id: I8230c1cacaa8145d96e6e5e251078cd28d267ae7 Signed-off-by: yangyan Issue-ID: VFC-1360 --- docker/docker-env-conf.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'docker') diff --git a/docker/docker-env-conf.sh b/docker/docker-env-conf.sh index 6e610ca7..cc6f4960 100644 --- a/docker/docker-env-conf.sh +++ b/docker/docker-env-conf.sh @@ -1,6 +1,6 @@ #!/bin/bash -config_env(){ +install_sf(){ sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories apk --no-cache update @@ -8,6 +8,7 @@ config_env(){ apk --no-cache add python-dev libffi-dev musl-dev py2-virtualenv # get binary zip from nexus - vfc-nfvo-catalog + wget -q -O vfc-nfvo-catalog.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.catalog&a=vfc-nfvo-catalog&v=LATEST&e=zip' && \ unzip vfc-nfvo-catalog.zip && \ rm -rf vfc-nfvo-catalog.zip && \ @@ -15,7 +16,7 @@ config_env(){ pip install --no-cache-dir --pre -r /service/vfc/nfvo/catalog/requirements.txt } -add_onap(){ +add_user(){ apk --no-cache add sudo addgroup -g 1000 -S onap && \ @@ -23,20 +24,32 @@ add_onap(){ chmod u+w /etc/sudoers && \ sed -i '/User privilege/a\\onap ALL=(ALL:ALL) NOPASSWD:ALL' /etc/sudoers && \ chmod u-x /etc/sudoers && \ - chown onap:onap -R /service + sudo chown onap:onap -R /service +} + +config_logdir(){ + + if [ ! -d "/var/log/onap" ]; then + sudo mkdir /var/log/onap + fi + + sudo chown onap:onap -R /var/log/onap + chmod g+s /var/log/onap + } -clean_env(){ +clean_sf_cache(){ rm -rf /var/cache/apk/* rm -rf /root/.cache/pip/* rm -rf /tmp/* } -config_env +install_sf wait -add_onap -clean_env +add_user +config_logdir +clean_sf_cache -- cgit 1.2.3-korg