Use io.fabric8:docker-maven-plugin to build and push docker images
[policy/engine.git] / packages / docker / src / main / docker / Dockerfile
index c0ab881..7ef47b4 100644 (file)
@@ -1,42 +1,23 @@
-FROM ubuntu:14.04
+FROM onap/policy-common-alpine:1.4.0
 
-ARG HTTP_PROXY=${HTTP_PROXY}
-ARG HTTPS_PROXY=${HTTPS_PROXY}
+LABEL maintainer="Policy Team"
+
+ARG BUILD_VERSION_ENGINE=${BUILD_VERSION_ENGINE}
 ARG POLICY_LOGS=/var/log/onap
 
-ENV http_proxy $HTTP_PROXY
-ENV https_proxy $HTTPS_PROXY
+ENV BUILD_VERSION_ENGINE ${BUILD_VERSION_ENGINE}
 ENV POLICY_LOGS ${POLICY_LOGS}
 
-RUN \
-        apt-get clean && \
-        apt-get update && \
-        apt-get install -y zip unzip curl wget ssh telnet maven && \
-        apt-get install -y software-properties-common && \
-        apt-get install -y jq httpie && \
-        apt-get install -y python-pip && \
-        add-apt-repository ppa:openjdk-r/ppa && \
-        apt-get clean && \
-        apt-get update && \
-        apt-get install -y openjdk-8-jdk
-
-RUN useradd --create-home --shell /bin/bash policy
-
-# install MariaDB client
-RUN \
-    apt-get install -y apt-transport-https && \
-        apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db && \
-        add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu trusty main' && \
-        apt-get clean && \
-        apt-get update && \
-        apt-get install -y mariadb-client
-
-RUN mkdir -p /opt/app/policy /tmp/policy-install ${POLICY_LOGS} && \
-    chown policy /opt/app/policy /tmp/policy-install ${POLICY_LOGS}
+RUN apk add --no-cache mariadb-client
+
+RUN mkdir -p /tmp/policy-install ${POLICY_LOGS} && \
+    chown policy:policy /tmp/policy-install ${POLICY_LOGS} && \
+    rmdir ${POLICY_HOME}/etc/ssl && \
+    rmdir ${POLICY_HOME}/etc
 
 WORKDIR /tmp/policy-install
 
-COPY install.zip docker-install.sh do-start.sh wait-for-port.sh ./
+COPY /maven/install.zip docker-install.sh do-start.sh wait-for-port.sh ./
 RUN unzip install.zip && rm install.zip && chown policy * && chmod +x *.sh
 
 USER policy