summaryrefslogtreecommitdiffstats
path: root/ms/gra/gra-docker/src/main/docker/Dockerfile
blob: 37c2ee69134f5065f63458f38552017766a9921c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Prepare stage for multistage image build
## START OF STAGE0 ##
FROM @base.image.name@:@ccsdk.docker.version@ AS stage0

ENV LOG_PATH /var/log/onap/sdnc
ENV SDNC_CONFIG_DIR /opt/onap/sdnc/config
ENV TRUSTSTORE @onap.truststore@
ENV JAVA_SECURITY_DIR /opt/java/openjdk/lib/security
USER root

# copy deliverables to opt
COPY opt /opt

# Install ONAP certificates
RUN keytool -importkeystore -srckeystore ${SDNC_CONFIG_DIR}/${TRUSTSTORE} -srcstorepass changeit -destkeystore ${JAVA_SECURITY_DIR}/cacerts -deststorepass changeit -noprompt

## END OF STAGE0 ##


FROM @base.image.name@:@ccsdk.docker.version@

MAINTAINER SDNC Team (onap-sdnc@lists.onap.org)

ENV PROJECT_VERSION @project.version@
ENV SDNC_HOME /opt/onap/sdnc
ENV SDNC_CONFIG_DIR /opt/onap/sdnc/config
ENV GRA_JAR @sdnc.gra.jar@
ENV SVCLOGIC_PROPERTIES /opt/onap/sdnc/config/svclogic.properties
ENV SVCLOGIC_DIR /opt/onap/sdnc/svclogic/graphs
ENV LOG_PATH /var/log/onap/sdnc

USER root

# Install sudo and IP utilities
RUN apk update && apk --no-cache add sudo iputils openssl

# Enable wheel group
RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers

# Create sdnc user
RUN addgroup -S sdnc && adduser -S sdnc -G sdnc
RUN addgroup sdnc wheel

COPY --from=stage0 --chown=sdnc:sdnc /opt /opt
RUN mkdir -p ${LOG_PATH} && chown sdnc:sdnc ${LOG_PATH}
RUN chmod +x ${SDNC_HOME}/bin/*.sh


USER sdnc
WORKDIR ${SDNC_HOME}
ENTRYPOINT /opt/onap/sdnc/bin/startGra.sh
EXPOSE 8443 8080