VES-Mapper container running as root 80/123580/1 1.3.0
authorMukesh Paliwal <mukesh.paliwal1@huawei.com>
Wed, 25 Aug 2021 18:52:51 +0000 (00:22 +0530)
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>
Wed, 25 Aug 2021 18:54:04 +0000 (00:24 +0530)
Issue-ID: DCAEGEN2-2859

Signed-off-by: Mukesh Paliwal <mukesh.paliwal1@huawei.com>
Change-Id: Ieb319d1c9fe255be9e9602a502371917af494e19

UniversalVesAdapter/pom.xml
UniversalVesAdapter/src/main/docker/Dockerfile [new file with mode: 0755]

index 604c1b2..1d9f955 100644 (file)
                                                <imageTag>${project.version}</imageTag>
                                                <imageTag>latest</imageTag>
                                        </imageTags>
-                                       <baseImage>openjdk:11-jre-slim</baseImage>
-                                       <env>
-                                               <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
-                                       </env>
-                                       <workdir>/opt/app/VESAdapter</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>chmod +x bin/run.sh</run>
-                                               <run>
-                                                       <![CDATA[apt-get update && apt-get install -y --no-install-recommends procps && apt-get install -y vim && apt-get install -y curl && apt-get clean all]]>
-                                               </run>
-                                       </runs>
-                                       <exposes>
-                                               <expose>8080</expose>
-                                               <expose>8443</expose>
-                                       </exposes>
-                                       <entryPoint>bin/run.sh</entryPoint>
-
                                </configuration>
                                <!--<executions> <execution> <id>build-image</id> <phase>package</phase> 
                                        <goals> <goal>build</goal> </goals> </execution> <execution> <id>tag-and-push-image-latest</id> 
diff --git a/UniversalVesAdapter/src/main/docker/Dockerfile b/UniversalVesAdapter/src/main/docker/Dockerfile
new file mode 100755 (executable)
index 0000000..d932c52
--- /dev/null
@@ -0,0 +1,24 @@
+FROM nexus3.onap.org:10001/onap/integration-java11:9.0.0
+
+ENV HOSTALIASES /etc/host.aliases
+
+ARG user=VESAdapter
+ARG group=VESAdapter
+
+USER root
+WORKDIR /opt/app/VESAdapter
+
+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/VESAdapter && \
+    chmod -R u+rw /opt/app/VESAdapter/
+
+USER  $user
+
+COPY --chown=$user:$group /. /opt/app/VESAdapter/
+
+RUN chmod +x bin/run.sh
+
+EXPOSE 8080 8443
+
+ENTRYPOINT ["bin/run.sh"]