Migrate HAS base image to alpine. 41/71841/2
authorAdolfo Perez-Duran <ado@orangemonk.net>
Mon, 5 Nov 2018 13:52:48 +0000 (06:52 -0700)
committerAdolfo Perez-Duran <adolfo@orangemonk.net>
Wed, 28 Nov 2018 13:40:44 +0000 (13:40 +0000)
Make HAS container image smaller and platform-agnostic.

Issue-ID: INT-551
Change-Id: Icee2b3137142dde1689de71f30bb0d5c791ce84c
Signed-off-by: Adolfo Perez-Duran <adolfo@orangemonk.net>
conductor/docker/Dockerfile

index 0222c9f..b68ebaf 100755 (executable)
@@ -15,7 +15,7 @@
 #
 # -------------------------------------------------------------------------
 
-FROM python:2.7
+FROM python:2.7-alpine
 
 ARG MVN_ARTIFACT_VERSION
 ARG REPO
@@ -29,15 +29,28 @@ ENV CON_PORT "8091"
 
 EXPOSE ${CON_PORT}
 
-RUN apt-get update && apt-get --assume-yes install python-setuptools && \
-apt-get install -y unzip curl wget git vim
+# Add required libraries
+RUN apk add --no-cache  curl \
+                        gcc \
+                        libffi-dev \
+                        linux-headers \
+                        musl-dev \
+                        git \
+                        libxml2-dev \
+                        libxslt-dev \
+                        openssl-dev \
+                        py-setuptools \
+                        unzip \
+                        wget \
+                        xvfb 
 
-# HAS
 WORKDIR /opt/has
 RUN wget -O /opt/has.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.optf.has&a=optf-has-conductor&e=zip&v=${MVN_ARTIFACT_VERSION}" && \
     unzip -q -o -B /opt/has.zip -d /opt/has && \
     rm -f /opt/has.zip
 RUN mkdir -p /var/log/onap/optf/has/
 
-RUN cd /opt/has/conductor/ && git init && pip install -e .
+RUN cd /opt/has/conductor && \ 
+     git init && \ 
+     pip install -e .
 COPY api_paste.ini /usr/local/bin/api_paste.ini