Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 1 | # Prepare stage for multistage image build |
| 2 | ## START OF STAGE0 ## |
| 3 | FROM ${base.image.name}:${project.docker.latestfulltag.version} AS stage0 |
| 4 | |
| 5 | ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 6 | ENV LOG_PATH /var/log/onap/ccsdk |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 7 | |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 8 | |
| 9 | # copy deliverables to opt |
| 10 | COPY opt /opt |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 11 | |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 12 | ## END OF STAGE0 ## |
| 13 | |
| 14 | |
| 15 | FROM ${base.image.name}:${project.docker.latestfulltag.version} |
| 16 | |
| 17 | MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org) |
| 18 | |
| 19 | ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 20 | ENV CCSDK_HOME /opt/onap/ccsdk |
| 21 | ENV SLIBOOT_JAR ${ccsdk.sliboot.jar} |
| 22 | ENV SVCLOGIC_PROPERTIES /opt/onap/ccsdk/config/svclogic.properties |
| 23 | ENV SVCLOGIC_DIR /opt/onap/ccsdk/svclogic/graphs |
| 24 | ENV LOG_PATH /var/log/onap/ccsdk |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 25 | |
| 26 | # Install sudo and IP utilities |
| 27 | RUN apk update && apk --no-cache add sudo iputils openssl |
| 28 | |
| 29 | |
| 30 | # Enable wheel group |
| 31 | RUN sed -e 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' -i /etc/sudoers |
| 32 | |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 33 | # Create sli user |
| 34 | RUN addgroup -S sli && adduser -S sli -G sli |
| 35 | RUN addgroup sli wheel |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 36 | |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 37 | COPY --from=stage0 --chown=sli:sli /opt /opt |
| 38 | RUN mkdir -p ${LOG_PATH} && chown sli:sli ${LOG_PATH} |
| 39 | RUN chmod +x ${CCSDK_HOME}/bin/*.sh |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 40 | |
Dan Timoney | 1de1361 | 2020-03-23 14:58:06 -0400 | [diff] [blame] | 41 | |
Dan Timoney | ca18ff3 | 2020-03-24 10:13:29 -0400 | [diff] [blame] | 42 | USER sli |
| 43 | WORKDIR ${CCSDK_HOME} |
| 44 | ENTRYPOINT /opt/onap/ccsdk/bin/startSliboot.sh |
| 45 | EXPOSE 8080 |