Use base image for SO dockers 78/102978/1
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 4 Mar 2020 12:27:11 +0000 (13:27 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 4 Mar 2020 12:28:31 +0000 (13:28 +0100)
ONAP now has a specific base image for all containers using Java. This
commit uses this file instead of creating a base image only for SO.

Issue-ID: SO-2694
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: I9578e4d5556bd175ad65c6d2f9ce917997651c7a

packages/docker/src/main/docker/docker-files/Dockerfile.so-app
packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image [deleted file]
packages/docker/src/main/docker/docker-files/scripts/start-app.sh

index e8f02f1..84bd298 100644 (file)
@@ -1,4 +1,4 @@
-FROM onap/so/base-image:1.0
+FROM registry.gitlab.com/onap-integration/docker/onap-java
 
 ARG http_proxy
 ENV HTTP_PROXY=$http_proxy
@@ -7,22 +7,18 @@ ARG https_proxy
 ENV HTTPS_PROXY=$https_proxy
 ENV https_proxy=$HTTPS_PROXY
 
-RUN mkdir /app && mkdir /app/config && mkdir /app/certificates && mkdir /app/logs  && mkdir /app/ca-certificates
+USER root
+RUN mkdir -p /app/{config,certificates,logs,ca-certificates}
+RUN chown -R onap:onap /app && chmod 700 /app/*.sh
 
+USER onap
 COPY maven/app.jar /app
 COPY configs/logging/logback-spring.xml /app
 COPY scripts/start-app.sh /app
 COPY scripts/wait-for.sh /app
 COPY ca-certificates/onap-ca.crt /app/ca-certificates/onap-ca.crt
 
-RUN chown -R so:so /app && chmod 700 /app/*.sh
-
-## TODO for Casablanca: install this in the openstack-adapter container
-## Install heatbridge
-#RUN apt-get install -y python && apt-get install -y python-pip && echo 'PIP Installed, doing upgrade' && pip install --upgrade pip
-#RUN mkdir /opt/mso/heatbridge
-#COPY heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl /opt/mso/heatbridge
-#RUN pip install /opt/mso/heatbridge/heatbridge-0.3.0.dev0-py2-none-any.whl
+RUN chmod 700 /app/*.sh
 
 # Springboot configuration (required)
 VOLUME /app/config
diff --git a/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image b/packages/docker/src/main/docker/docker-files/Dockerfile.so-base-image
deleted file mode 100644 (file)
index c0b298e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-FROM docker.io/openjdk:8-jdk-alpine
-
-ARG http_proxy
-ARG https_proxy
-ENV HTTP_PROXY=$http_proxy
-ENV HTTPS_PROXY=$https_proxy
-ENV http_proxy=$HTTP_PROXY
-ENV https_proxy=$HTTPS_PROXY
-
-# Update the package list and upgrade installed packages
-RUN apk update && apk upgrade
-
-# Install commonly needed tools
-RUN apk --no-cache add curl netcat-openbsd sudo nss
-
-# Create 'so' user
-RUN addgroup -g 1000 so && adduser -S -u 1000 -G so -s /bin/sh so
index 75d64fe..ebab3c6 100644 (file)
@@ -16,9 +16,9 @@ then
                update-ca-certificates --fresh
        fi
 
-       # Re-exec this script as the 'so' user.
+       # Re-exec this script as the 'onap' user.
        this=`readlink -f $0`
-       exec su so -c  "$this"
+       exec su onap -c  "$this"
 fi
 
 touch /app/app.jar