blob: fb2abe96c268c3aff3847e73beea264f50969e65 [file] [log] [blame]
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02001#
2# ============LICENSE_START=======================================================
3# O-RAN-SC
4# ================================================================================
BjornMagnussonXA239919f2023-03-20 18:10:36 +01005# Copyright (C) 2021-2023 Nordix Foundation. All rights reserved.
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02006# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#
19# SPDX-License-Identifier: Apache-2.0
20# ============LICENSE_END=========================================================
21
22
BjornMagnussonXA239919f2023-03-20 18:10:36 +010023FROM openjdk:17-jdk as jre-build
24
25RUN $JAVA_HOME/bin/jlink \
26--verbose \
27--add-modules ALL-MODULE-PATH \
28--strip-debug \
29--no-man-pages \
30--no-header-files \
31--compress=2 \
32--output /customjre
33
34# Use debian base image (same as openjdk uses)
35FROM debian:11-slim
36
37ENV JAVA_HOME=/jre
38ENV PATH="${JAVA_HOME}/bin:${PATH}"
39
40#copy JRE from the base image
41COPY --from=jre-build /customjre $JAVA_HOME
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020042
43EXPOSE 8084 8435
44
45ARG JAR
46
47WORKDIR /opt/app/dmaap-adapter-service
48RUN mkdir -p /var/log/dmaap-adapter-service
49RUN mkdir -p /opt/app/dmaap-adapter-service/etc/cert/
50RUN mkdir -p /var/dmaap-adapter-service
51
52ADD /config/application.yaml /opt/app/dmaap-adapter-service/config/application.yaml
53ADD /config/application_configuration.json /opt/app/dmaap-adapter-service/data/application_configuration.json_example
54ADD /config/keystore.jks /opt/app/dmaap-adapter-service/etc/cert/keystore.jks
55ADD /config/truststore.jks /opt/app/dmaap-adapter-service/etc/cert/truststore.jks
56
57ARG user=nonrtric
58ARG group=nonrtric
59
60RUN groupadd $user && \
61 useradd -r -g $group $user
62RUN chown -R $user:$group /opt/app/dmaap-adapter-service
63RUN chown -R $user:$group /var/log/dmaap-adapter-service
64RUN chown -R $user:$group /var/dmaap-adapter-service
65
66USER ${user}
67
68ADD target/${JAR} /opt/app/dmaap-adapter-service/dmaap-adapter.jar
BjornMagnussonXA239919f2023-03-20 18:10:36 +010069CMD ["/jre/bin/java", "-jar", "/opt/app/dmaap-adapter-service/dmaap-adapter.jar"]