3 ARG MICRO_HOME=/opt/app/crud-api
4 ARG BIN_HOME=$MICRO_HOME/bin
8 # Install and setup java8
9 RUN apt-get update && apt-get install -y software-properties-common
10 ## sudo -E is required to preserve the environment. If you remove that line, it will most like freeze at this step
11 RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk
12 ## Setup JAVA_HOME, this is useful for docker commandline
13 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
16 # Build up the deployment folder structure
17 RUN mkdir -p $MICRO_HOME
18 RUN mkdir -p $MICRO_HOME/bundleconfig/etc
19 COPY gizmo.jar $MICRO_HOME/
20 RUN mkdir -p $BIN_HOME
22 COPY bundleconfig-local $MICRO_HOME/bundleconfig
23 COPY bundleconfig-local/etc/logback.xml $MICRO_HOME/bundleconfig/etc
24 RUN chmod 755 $BIN_HOME/*
26 # Changes related to:AAI-2177
27 # Change aai gizmo container processes to run as non-root on the host
29 #Note:The group id and user id used below (492382 & 341790 respectively) are chosen arbitarily based on assumption that
30 # these are not used elsewhere. Please see https://jira.onap.org/browse/AAI-2172 for more background on this.
32 RUN mkdir /opt/aaihome && \
33 groupadd -g 492382 aaiadmin && \
34 useradd -r -u 341790 -g 492382 -ms /bin/sh -d /opt/aaihome/aaiadmin aaiadmin && \
35 chown -R aaiadmin:aaiadmin $MICRO_HOME &&\
37 chown -R aaiadmin:aaiadmin /logs
41 RUN ln -s /logs $MICRO_HOME/logs
45 CMD ["/opt/app/crud-api/bin/start.sh"]