JoeOLeary | becd8ee | 2019-01-28 13:44:27 +0000 | [diff] [blame] | 1 | # |
| 2 | # ============LICENSE_START======================================================= |
JoeOLeary | 2552356 | 2020-01-14 10:54:59 +0000 | [diff] [blame] | 3 | # Copyright (C) 2019-2020 Nordix Foundation. |
JoeOLeary | becd8ee | 2019-01-28 13:44:27 +0000 | [diff] [blame] | 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | # |
JoeOLeary | d5270c6 | 2020-06-22 14:01:13 +0100 | [diff] [blame] | 20 | FROM openjdk:11.0.7-jre-slim |
dfarrelly | 2d336f9 | 2019-02-22 15:31:10 +0000 | [diff] [blame] | 21 | |
JoeOLeary | 924ab47 | 2019-02-15 13:46:01 +0000 | [diff] [blame] | 22 | WORKDIR /opt/app/pm-mapper |
dfarrelly | 2d336f9 | 2019-02-22 15:31:10 +0000 | [diff] [blame] | 23 | |
JoeOLeary | d5270c6 | 2020-06-22 14:01:13 +0100 | [diff] [blame] | 24 | RUN apt-get update && \ |
Remigiusz Janeczek | ae8adbc | 2020-07-06 08:56:09 +0200 | [diff] [blame] | 25 | apt-get install --no-install-recommends -y curl nano && \ |
JoeOLeary | d5270c6 | 2020-06-22 14:01:13 +0100 | [diff] [blame] | 26 | apt-get clean && \ |
| 27 | rm -rf /var/lib/apt/lists/* |
ejamcud | 8dda7f1 | 2019-07-11 14:17:55 +0100 | [diff] [blame] | 28 | |
dfarrelly | 2d336f9 | 2019-02-22 15:31:10 +0000 | [diff] [blame] | 29 | RUN mkdir -p /var/log/ONAP |
dfarrelly | 2d336f9 | 2019-02-22 15:31:10 +0000 | [diff] [blame] | 30 | |
dfarrelly | 924a805 | 2019-07-24 16:17:13 +0000 | [diff] [blame] | 31 | RUN adduser pm-mapper; \ |
| 32 | chmod a+rwx /var/log/ONAP; \ |
| 33 | chown -R pm-mapper /opt/app/pm-mapper |
dfarrelly | 2d336f9 | 2019-02-22 15:31:10 +0000 | [diff] [blame] | 34 | |
| 35 | USER pm-mapper |
dfarrelly | 924a805 | 2019-07-24 16:17:13 +0000 | [diff] [blame] | 36 | |
| 37 | COPY ${project.build.directory}/${ext.dep.dir.path}/ ${ext.dep.dir.path}/ |
| 38 | COPY ${project.build.directory}/${JAR} . |
| 39 | |
JoeOLeary | 2552356 | 2020-01-14 10:54:59 +0000 | [diff] [blame] | 40 | COPY ${project.build.directory}/classes/schemas ./etc/schemas/ |
| 41 | COPY ${project.build.directory}/classes/templates ./etc/templates/ |
dfarrelly | 924a805 | 2019-07-24 16:17:13 +0000 | [diff] [blame] | 42 | COPY ${project.build.directory}/classes/reconfigure.sh ./etc/reconfigure.sh |
| 43 | COPY --chown=pm-mapper ${project.build.directory}/classes/logback.xml ./etc/logback.xml |
| 44 | |
| 45 | |
| 46 | LABEL git.branch="${git.branch}" \ |
| 47 | git.build.host="${git.build.host}" \ |
| 48 | git.build.time="${git.build.time}" \ |
| 49 | git.build.user.email="${git.build.user.email}" \ |
| 50 | git.build.user.name="${git.build.user.name}" \ |
| 51 | git.build.version="${git.build.version}" \ |
| 52 | git.closest.tag.name="${git.closest.tag.name}" \ |
| 53 | git.commit.id="${git.commit.id}" \ |
| 54 | git.commit.message.short="${git.commit.message.short}" \ |
| 55 | git.commit.time="${git.commit.time}" \ |
| 56 | git.commit.user.email="${git.commit.user.email}" \ |
| 57 | git.commit.user.name="${git.commit.user.name}" |
| 58 | |
| 59 | |
JoeOLeary | 014b937 | 2020-08-04 12:58:01 +0100 | [diff] [blame^] | 60 | ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "${project.artifactId}-${project.version}.jar"] |
dfarrelly | 924a805 | 2019-07-24 16:17:13 +0000 | [diff] [blame] | 61 | ARG JAR |