summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMukesh Paliwal <mukesh.paliwal1@huawei.com>2022-01-13 09:01:16 +0530
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>2022-01-15 09:09:31 +0530
commit7a85ea009149edc8aff260d559debbd45af02b03 (patch)
tree41595f65710115cbedf8f450f2bc616b006857cb
parent584fb3ef9143e2e241688a32f95b5a9f81e400b3 (diff)
Switch RESTCONF Collector to Integration base image
Issue-ID: DCAEGEN2-2962 Signed-off-by: Mukesh Paliwal <mukesh.paliwal1@huawei.com> Change-Id: I9fda9836e119862f143ea5a649f852cebdfb1be9
-rw-r--r--Changelog.md3
-rw-r--r--pom.xml69
-rwxr-xr-xsrc/main/docker/Dockerfile25
-rw-r--r--version.properties4
4 files changed, 33 insertions, 68 deletions
diff --git a/Changelog.md b/Changelog.md
index 6345c10..f901c73 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -4,6 +4,9 @@ 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.3.0] - 2022/01/13
+ - [DCAEGEN2-2962] - Switch RESTCONF Collector to Integration base image
+
## [1.2.6] - 2021/12/14
- [DCAEGEN2-3022] - Remediation for Log4Shell vulnerability
diff --git a/pom.xml b/pom.xml
index 6349069..a2673cc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<!--
================================================================================
-Copyright (c) 2019 Huawei. All rights reserved.
Copyright (c) 2019,2021 AT&T. All rights reserved.
+Copyright (c) 2022 Huawei. 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.
@@ -27,7 +27,7 @@ limitations under the License.
</parent>
<groupId>org.onap.dcaegen2.collectors.restconf</groupId>
<artifactId>restconfcollector</artifactId>
- <version>1.2.6-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<name>dcaegen2-collectors-restconf</name>
<description>RestConfCollector</description>
<properties>
@@ -203,77 +203,14 @@ limitations under the License.
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
- <baseImage>openjdk:11-jre-slim</baseImage>
- <user>${docker.user.name}</user>
- <env>
- <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
- </env>
- <workdir>${docker.user.dir}</workdir>
+ <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>.</targetPath>
<directory>${project.build.directory}/${project.artifactId}-${project.version}</directory>
</resource>
</resources>
- <runs>
- <run>useradd -r -U ${docker.user.name}</run>
- <run>chown -R ${docker.user.name}:${docker.user.name} ${docker.user.dir}</run>
- <run>chmod +x ${docker.user.dir}/bin/*.sh</run>
- </runs>
- <cmd>${docker.user.dir}/bin/docker_entry.sh</cmd>
- <exposes>
- <expose>8080</expose>
- <expose>8687</expose>
- </exposes>
- <user>${docker.user.name}</user>
</configuration>
-<!--
- <executions>
- <execution>
- <id>build-image</id>
- <phase>package</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>tag-and-push-image-latest</id>
- <phase>deploy</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>${docker.image.name}:latest</image>
- <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
- <pushImage>true</pushImage>
- </configuration>
- </execution>
- <execution>
- <id>tag-and-push-image-with-version</id>
- <phase>deploy</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>${docker.image.name}:latest</image>
- <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}</newName>
- <pushImage>false</pushImage>
- </configuration>
- </execution>
- <execution>
- <id>tag-and-push-image-with-version-and-date</id>
- <phase>deploy</phase>
- <goals>
- <goal>tag</goal>
- </goals>
- <configuration>
- <image>${docker.image.name}:latest</image>
- <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z</newName>
- <pushImage>false</pushImage>
- </configuration>
- </execution>
- </executions>
--->
</plugin>
</plugins>
</build>
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
new file mode 100755
index 0000000..786ef00
--- /dev/null
+++ b/src/main/docker/Dockerfile
@@ -0,0 +1,25 @@
+FROM nexus3.onap.org:10001/onap/integration-java11:10.0.0
+
+ENV HOSTALIASES /etc/host.aliases
+
+ARG user=restconfcollector
+ARG group=restconfcollector
+
+USER root
+WORKDIR /opt/app/restconfcollector
+
+RUN apk --no-cache update && apk --no-cache upgrade && apk add --upgrade procps && apk add --no-cache vim && apk --no-cache add curl && \
+ addgroup $group && adduser --system --disabled-password --no-create-home --ingroup $group $user && \
+ chown -R $user:$group /opt/app/restconfcollector && \
+ chmod -R u+rw /opt/app/restconfcollector
+
+USER $user
+
+COPY --chown=$user:$group /. /opt/app/restconfcollector/
+
+RUN chmod +x bin/docker_entry.sh
+RUN chmod +x bin/restConfCollector.sh
+
+EXPOSE 8080 8687
+
+ENTRYPOINT ["bin/docker_entry.sh"]
diff --git a/version.properties b/version.properties
index 0cb18ba..7d6815b 100644
--- a/version.properties
+++ b/version.properties
@@ -1,6 +1,6 @@
major=1
-minor=2
-patch=6
+minor=3
+patch=0
base_version=${major}.${minor}.${patch}
release_version=${base_version}
snapshot_version=${base_version}-SNAPSHOT