From 347b1c864daea16f2f25bd4aafee6dc3a3ee13cb Mon Sep 17 00:00:00 2001 From: xuegao Date: Mon, 17 Oct 2022 14:08:54 +0200 Subject: Dockerizing simulators Create docker images for Core nssmf simulator. Issue-ID: INT-2162 Signed-off-by: xuegao Change-Id: Iee63f3d430d38442244d14c1baaf57859f7e6c1b --- pom.xml | 99 ++++++++++++++++++++++++++++++++- src/main/docker/docker-files/Dockerfile | 12 ++++ src/main/docker/docker-files/startup.sh | 21 +++++++ 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 src/main/docker/docker-files/Dockerfile create mode 100644 src/main/docker/docker-files/startup.sh diff --git a/pom.xml b/pom.xml index 7ee264d..d88e593 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,9 @@ UTF-8 UTF-8 1.8 + nexus3.onap.org:10001 + 1.0.0 + 2.8.9 @@ -59,6 +62,11 @@ spring-boot-starter-tomcat provided + + javax.xml.bind + jaxb-api + 2.3.1 + @@ -70,6 +78,93 @@ - - + + + docker + + false + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-jar + verify + + copy-resources + + + ${basedir}/src/main/docker/docker-files + true + + + ${basedir}/target + + simulator-${project.version}.jar + + + + + + + + + io.fabric8 + docker-maven-plugin + 0.28.0 + + true + 1.23 + ${docker.registry} + + + core-nssmf-simulator + + try + docker-files + Dockerfile + + ${docker.image.version} + + + + + + + + clean-images + pre-clean + + remove + + + true + + + + generate-images + verify + + build + + + + + + + + + diff --git a/src/main/docker/docker-files/Dockerfile b/src/main/docker/docker-files/Dockerfile new file mode 100644 index 0000000..08b55a3 --- /dev/null +++ b/src/main/docker/docker-files/Dockerfile @@ -0,0 +1,12 @@ +FROM onap/integration-java11:10.0.0 + +WORKDIR /home/onap + +USER onap + +COPY --chown=onap:onap simulator-0.0.1-SNAPSHOT.jar /home/onap/simulator-0.0.1-SNAPSHOT.jar +COPY --chown=onap:onap startup.sh /home/onap/startup.sh + +RUN chmod 700 /home/onap/startup.sh + +ENTRYPOINT [ "sh", "-c", "/home/onap/startup.sh"] diff --git a/src/main/docker/docker-files/startup.sh b/src/main/docker/docker-files/startup.sh new file mode 100644 index 0000000..63b6f03 --- /dev/null +++ b/src/main/docker/docker-files/startup.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2022 AT&T Intellectual Property. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +java -jar /home/onap/simulator-0.0.1-SNAPSHOT.jar --spring.config.location=/home/onap/app/application.properties -- cgit 1.2.3-korg