Change openjdk baseOS img to integration-java11 57/118057/10
authorAlexander Mazuruk <a.mazuruk@samsung.com>
Thu, 18 Feb 2021 16:04:21 +0000 (17:04 +0100)
committerAlexander Mazuruk <a.mazuruk@samsung.com>
Fri, 30 Apr 2021 02:51:42 +0000 (04:51 +0200)
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

Changelog.md
datafile-app-server/pom.xml
datafile-app-server/src/main/docker/Dockerfile
pom.xml
version.properties

index 7909780..0dc2c45 100644 (file)
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## [1.6.0] - 25/02/2021 
+### Changed
+- docker base image to integration (from debian based to alpine based)
+- java version bump from 11.0.8 to 11.0.9
+- remove exec file permission for config file
+
 ## [1.5.5] - 09/03/2021
 ### Fixed
 - make hostname verification configurable
index 9c89586..4b84f6e 100644 (file)
@@ -4,6 +4,7 @@
   ~ Copyright (C) 2018-2021 NOKIA Intellectual Property. All rights reserved.
   ~ Copyright (C) 2018-2021 Nordix Foundation. All rights reserved.
   ~ Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+  ~ Copyright (c) 2021 Samsung Electronics. 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.
@@ -26,7 +27,7 @@
     <parent>
         <groupId>org.onap.dcaegen2.collectors</groupId>
         <artifactId>datafile</artifactId>
-        <version>1.5.5-SNAPSHOT</version>
+        <version>1.6.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.dcaegen2.collectors.datafile</groupId>
index 73d09bf..26a2ca4 100755 (executable)
@@ -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.
 # 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"]
diff --git a/pom.xml b/pom.xml
index 08f5fbf..e9aa77b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,6 +3,7 @@
   ~ ============LICENSE_START=====================================================================
   ~ Copyright (C) 2018-2021 NOKIA Intellectual Property. All rights reserved.
   ~ Copyright (C) 2018-2021 Nordix Foundation. All rights reserved.
+  ~ Copyright (C) 2021 Samsung Electronics. 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.
@@ -31,7 +32,7 @@
 
     <groupId>org.onap.dcaegen2.collectors</groupId>
     <artifactId>datafile</artifactId>
-    <version>1.5.5-SNAPSHOT</version>
+    <version>1.6.0-SNAPSHOT</version>
 
     <name>dcaegen2-collectors.datafile</name>
     <description>datafile collector</description>
index 1daaf2d..d76ac72 100644 (file)
@@ -1,6 +1,6 @@
 major=1\r
-minor=5\r
-patch=5\r
+minor=6\r
+patch=0\r
 base_version=${major}.${minor}.${patch}\r
 release_version=${base_version}\r
 snapshot_version=${base_version}-SNAPSHOT\r