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