Use alpine for MultiCloud FCAPS plugin 38/85138/3
authorLiexiang Yue <yueliexiang@chinamobile.com>
Fri, 12 Apr 2019 03:19:04 +0000 (11:19 +0800)
committerLiexiang Yue <yueliexiang@chinamobile.com>
Fri, 12 Apr 2019 03:42:06 +0000 (11:42 +0800)
This patch change the base image to python:2-alpine

Issue-ID: MULTICLOUD-499

Change-Id: I8fed9c774eabab496fa07acd96b7f759e20b123e
Signed-off-by: Liexiang Yue <yueliexiang@chinamobile.com>
fcaps/docker/Dockerfile
fcaps/run.sh

index d3c3750..015c795 100644 (file)
@@ -1,4 +1,4 @@
-FROM python:2-slim
+FROM python:2-alpine
 
 ARG HTTP_PROXY=${HTTP_PROXY}
 ARG HTTPS_PROXY=${HTTPS_PROXY}
@@ -16,20 +16,18 @@ ENV AAI_PASSWORD "AAI"
 
 EXPOSE 9011
 
-RUN groupadd -r onap && useradd -r -g onap onap
+RUN addgroup -S onap && adduser -S -G onap onap
 # COPY ./ /opt/fcaps/
 
-RUN apt-get update && \
-    apt-get install -y memcached wget unzip gcc libssl-dev && \
-    apt-get install -y unzip && \
+RUN apk update && \
+    apk add uwsgi memcached wget unzip gcc make libc-dev libffi-dev openssl-dev && \
     cd /opt/ && \
     wget -O multicloud-openstack-fcaps.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.multicloud.openstack&a=multicloud-openstack-fcaps&e=zip&v=1.3.0-SNAPSHOT" && \
     unzip -q -o -B multicloud-openstack-fcaps.zip && \
     chmod +x /opt/fcaps/*.sh && \
     rm -f multicloud-openstack-fcaps.zip && \
     pip install -r /opt/fcaps/requirements.txt && \
-    apt-get --purge remove -y wget unzip gcc libssl-dev && \
-    apt-get -y autoremove && \
+    apk del -y wget unzip gcc make libc-dev libffi-dev openssl-dev && \
     mkdir -p /var/log/onap/multicloud/fcaps && \
     chown onap:onap /var/log/onap -R && \
     chown onap:onap /opt/fcaps -R
index 5145002..088a04c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # Copyright (c) 2017-2019 Wind River Systems, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@ export PYTHONPATH=lib/share
 nohup celery -A fcaps worker --concurrency=1 --loglevel=info &
 
 #nohup python manage.py runserver 0.0.0.0:9011 2>&1 &
-if [ ${SSL_ENABLED} = "true" ]; then
+if [ "${SSL_ENABLED}" == "true" ]; then
     nohup uwsgi --https :9001,fcaps/pub/ssl/cert/cert.crt,fcaps/pub/ssl/cert/cert.key,HIGH --module fcaps.wsgi --master --enable-threads --processes 4 &
 else
     nohup uwsgi --http :9011 --module fcaps.wsgi --master --enable-threads --processes 4 &