aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMukesh Paliwal <mukesh.paliwal1@huawei.com>2021-08-26 00:22:51 +0530
committerMukesh Paliwal <mukesh.paliwal1@huawei.com>2021-08-26 00:24:04 +0530
commit108c76d514ac508023d2ab3ea9b92dff423b8182 (patch)
tree91ca49828bb4fab5a170afa853c3c4335fa3e8ad
parente57d9b6e87560713a5ec71ec683b82b5c8603b33 (diff)
VES-Mapper container running as root1.3.0
Issue-ID: DCAEGEN2-2859 Signed-off-by: Mukesh Paliwal <mukesh.paliwal1@huawei.com> Change-Id: Ieb319d1c9fe255be9e9602a502371917af494e19
-rw-r--r--UniversalVesAdapter/pom.xml18
-rwxr-xr-xUniversalVesAdapter/src/main/docker/Dockerfile24
2 files changed, 25 insertions, 17 deletions
diff --git a/UniversalVesAdapter/pom.xml b/UniversalVesAdapter/pom.xml
index 604c1b2..1d9f955 100644
--- a/UniversalVesAdapter/pom.xml
+++ b/UniversalVesAdapter/pom.xml
@@ -333,29 +333,13 @@
<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
index 0000000..d932c52
--- /dev/null
+++ b/UniversalVesAdapter/src/main/docker/Dockerfile
@@ -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"]