VES-Mapper container running as root 95/123195/2
authorMukesh Paliwal <mukesh.paliwal1@huawei.com>
Mon, 9 Aug 2021 16:19:19 +0000 (21:49 +0530)
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>
Mon, 9 Aug 2021 16:24:27 +0000 (21:54 +0530)
Issue-ID: DCAEGEN2-2859

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

UniversalVesAdapter/pom.xml

index 604c1b2..44329f3 100644 (file)
@@ -43,7 +43,8 @@
                <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
                <java.version>11</java.version>
                <docker.image.name>onap/org.onap.dcaegen2.services.mapper.vesadapter.universalvesadaptor</docker.image.name>
-
+               <docker.user.name>VESAdapter</docker.user.name>
+               <docker.user.dir>/opt/app/VESAdapter</docker.user.dir>
                <!-- PLUGIN SETTINGS -->
                <dependency.locations.enabled>false</dependency.locations.enabled>
 
                                                <imageTag>${project.version}</imageTag>
                                                <imageTag>latest</imageTag>
                                        </imageTags>
-                                       <baseImage>openjdk:11-jre-slim</baseImage>
+                                       <baseImage>onap/integration-java11:9.0.0</baseImage>
                                        <env>
                                                <HOSTALIASES>/etc/host.aliases</HOSTALIASES>
                                        </env>
-                                       <workdir>/opt/app/VESAdapter</workdir>
+                                       <workdir>${docker.user.dir}</workdir>
                                        <resources>
                                                <resource>
                                                        <targetPath>.</targetPath>
                                                </resource>
                                        </resources>
                                        <runs>
-                                               <run>chmod +x bin/run.sh</run>
+                                               <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/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>
+                                       <cmd>${docker.user.dir}/bin/run.sh</cmd>
                                        <exposes>
                                                <expose>8080</expose>
                                                <expose>8443</expose>
                                        </exposes>
-                                       <entryPoint>bin/run.sh</entryPoint>
-
+                                       <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>