1 FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@
3 ARG MICRO_HOME=/opt/app/data-router
4 ARG BIN_HOME=$MICRO_HOME/bin
5 ARG DR_LOGS=/var/log/onap/AAI-DR
7 # AAI-2176 Additional optional steps for Ubuntu
8 RUN if ((uname -v | grep -i "ubuntu") || ( cat /etc/*release|grep -i "ubuntu") ) ; then \
9 #####################################
10 #if JAVA doesnt exist then install it:
11 ######################################
12 if type java 2>/dev/null; then \
13 echo "skipping java installation"; \
15 apt-get update && apt-get install -y software-properties-common; \
16 ## sudo -E is required to preserve the environment. If you remove that line, it will most like freeze at this step
17 sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk ; \
18 ## Setup JAVA_HOME, this is useful for docker commandline
19 JAVA_HOME=usr/lib/jvm/java-8-openjdk-amd64; \
23 RUN mkdir -p $MICRO_HOME $MICRO_HOME/logs $DR_LOGS
25 RUN groupadd aaiadmin -g 1000
26 RUN adduser -u 1000 -h /opt/aaihome/aaiadmin -S -D -G aaiadmin -s /bin/bash aaiadmin
29 RUN chown -R aaiadmin:aaiadmin $MICRO_HOME $MICRO_HOME/logs $DR_LOGS
31 COPY --chown=aaiadmin:aaiadmin /maven/data-router/ .
35 RUN chmod 755 $BIN_HOME/* \
36 && ln -snf /logs $MICRO_HOME/logs
40 CMD ["/opt/app/data-router/bin/start.sh"]