summaryrefslogtreecommitdiffstats
path: root/datafile-app-server/src
diff options
context:
space:
mode:
authorAlexander Mazuruk <a.mazuruk@samsung.com>2021-02-18 17:04:21 +0100
committerAlexander Mazuruk <a.mazuruk@samsung.com>2021-04-30 04:51:42 +0200
commit015b548eb858a7a71a5e8b9a22a26d84289c9dd1 (patch)
tree7024ddefec3aba436d765132c9293fa5c0e9e67d /datafile-app-server/src
parentf400340aa75bebf8d1a0df9550acfafaf06c4cfb (diff)
Change openjdk baseOS img to integration-java11
Since 7.2.0 integration images switched over to alpine, adjusted Dockerfile to accomodate the switch. Removed vim & curl as they didn't seem to be used. Same with .ssh directory. Chowned config files and adjusted file permissions to u+rw (I assume configs dont need exec permissions) Benefits from switching over: * minimal {java11,python} images maintained by integration team * using currently "blessed by seccom" versions (:latest tag used) * should limit spread of legal issues across layers * integration images will be the first to have automated compliance documentation * should limit spread of base layers (contributing to deployment footprint - more base layers = more to download, more to store etc...) Issue-ID: INT-1864 Issue-ID: DCAEGEN2-2420 Signed-off-by: Alexander Mazuruk <a.mazuruk@samsung.com> Change-Id: Ic2d55ef33785fa048ee755d34eef94120124a7eb
Diffstat (limited to 'datafile-app-server/src')
-rwxr-xr-xdatafile-app-server/src/main/docker/Dockerfile30
1 files changed, 16 insertions, 14 deletions
diff --git a/datafile-app-server/src/main/docker/Dockerfile b/datafile-app-server/src/main/docker/Dockerfile
index 73d09bfe..26a2ca4d 100755
--- a/datafile-app-server/src/main/docker/Dockerfile
+++ b/datafile-app-server/src/main/docker/Dockerfile
@@ -2,6 +2,7 @@
# ============LICENSE_START=======================================================
# Copyright (C) 2019 Nordix Foundation.
# Copyright (C) 2020 Nokia.
+# Copyright (C) 2021 Samsung Electronics.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,28 +19,29 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
#
-FROM openjdk:11.0.8-jre-slim
+FROM nexus3.onap.org:10001/onap/integration-java11:8.0.0
EXPOSE 8100 8433
-RUN apt-get update && apt-get install -y \
- vim \
- curl
+ARG user=datafile
+ARG group=datafile
+USER root
WORKDIR /opt/app/datafile
-RUN mkdir -p /var/log/ONAP
-RUN mkdir -p /opt/app/datafile/etc/cert/
-
-RUN groupadd -r onap && useradd -ms /bin/bash datafile -g onap
-RUN chown -R datafile:onap /var/log/ONAP
ADD /config/application.yaml /opt/app/datafile/config/
-RUN chmod -R 777 /opt/app/datafile/config/
-USER datafile
+RUN mkdir -p /var/log/ONAP /opt/app/datafile/etc/cert/ && \
+ addgroup $group && adduser --system --disabled-password --no-create-home --ingroup $group $user && \
+ chown -R $user:$group /var/log/ONAP /opt/app/datafile/config && \
+ chmod -R u+rw /opt/app/datafile/config/
-RUN mkdir -p /home/datafile/.ssh
+# required for CSIT tests
+RUN apk add --no-cache openssh && \
+ mkdir -p /home/$user/.ssh && \
+ chown -R $user:$group /home/$user
-ADD /target/datafile-app-server.jar /opt/app/datafile/
+USER $user
-ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "/opt/app/datafile/datafile-app-server.jar"]
+COPY --chown=$user:$group /target/datafile-app-server.jar /opt/app/datafile/
+ENTRYPOINT ["java", "-jar", "/opt/app/datafile/datafile-app-server.jar"]