Move to alpine 35/82235/1
authorsebdet <sebastien.determe@intl.att.com>
Thu, 14 Mar 2019 10:06:33 +0000 (11:06 +0100)
committersebdet <sebastien.determe@intl.att.com>
Thu, 14 Mar 2019 10:07:03 +0000 (11:07 +0100)
Move docker image to alpine so that the footprint is reduced

Issue-ID: CLAMP-326
Change-Id: Ia3ee72e4aa648475a9960f40967c36128c5df618
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
src/main/docker/Dockerfile
src/main/docker/assembly/clamp-files.xml
src/main/docker/extra-files/startService.sh [deleted file]

index 983dea7..f2c7edd 100644 (file)
@@ -1,7 +1,7 @@
-FROM ubuntu:16.04\r
+FROM openjdk:8u191-jdk-alpine3.9\r
 \r
 MAINTAINER "The Onap Team"\r
-LABEL Description="This immage contains an updated ubuntu 16.04 with the openjdk installed" Version="16.04-8"\r
+LABEL Description="This immage contains alpine, openjdk 11 and clamp"\r
 \r
 ARG http_proxy\r
 ARG https_proxy\r
@@ -10,12 +10,7 @@ ENV HTTPS_PROXY=$https_proxy
 ENV http_proxy=$HTTP_PROXY\r
 ENV https_proxy=$HTTPS_PROXY\r
 \r
-RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /etc/apt/apt.conf.d/02proxy || true &&  \\r
-    apt-get update &&  \\r
-    apt-get -y dist-upgrade &&  \\r
-    apt-get install -y openjdk-8-jre-headless\r
-\r
-RUN groupadd -r onap && useradd --no-log-init -r -g onap clamp\r
+RUN addgroup onap && adduser -D -G onap clamp\r
 VOLUME /opt/clamp/config\r
 RUN mkdir /var/log/onap\r
 RUN chmod a+rwx /var/log/onap\r
@@ -23,11 +18,8 @@ RUN chmod a+rwx /var/log/onap
 COPY onap-clamp/clamp.jar /opt/clamp/app.jar\r
 RUN chmod 700 /opt/clamp/app.jar\r
 \r
-COPY onap-clamp/startService.sh /opt/clamp/startService.sh\r
-RUN chmod 700 /opt/clamp/startService.sh\r
-\r
 RUN chown -R clamp:onap /opt/clamp\r
 \r
 USER clamp\r
 WORKDIR /opt/clamp/\r
-ENTRYPOINT ./startService.sh \r
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Xms256m", "-Xmx1g", "-jar" ,"./app.jar"]\r
index c65a6c5..e4e9875 100644 (file)
                        <directory>${project.build.directory}</directory>
                        <outputDirectory>/</outputDirectory>
                </fileSet>
-               <fileSet>
-                       <includes>
-                               <include>**</include>
-                       </includes>
-                       <directory>src/main/docker/extra-files</directory>
-                       <outputDirectory>/</outputDirectory>
-               </fileSet>
        </fileSets>
 
 </assembly>
diff --git a/src/main/docker/extra-files/startService.sh b/src/main/docker/extra-files/startService.sh
deleted file mode 100644 (file)
index 3b73354..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-###
-# ============LICENSE_START=======================================================
-# ONAP CLAMP
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights
-#                             reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License"); 
-# you may not use this file except in compliance with the License. 
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
-# limitations under the License.
-# ============LICENSE_END============================================
-# ===================================================================
-# 
-###
-
-java -Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx1g -jar ./app.jar
-