talasila | 91d9079 | 2017-02-17 09:31:29 -0500 | [diff] [blame^] | 1 | # Pull base image. |
| 2 | #FROM ubuntu-openjdk-8-jdk |
| 3 | |
| 4 | FROM ubuntu:14.04 |
| 5 | |
| 6 | # Install the python script required for "add-apt-repository" |
| 7 | RUN apt-get update && apt-get install -y software-properties-common |
| 8 | |
| 9 | # Sets language to UTF8 : this works in pretty much all cases |
| 10 | ENV LANG en_US.UTF-8 |
| 11 | RUN locale-gen $LANG |
| 12 | |
| 13 | # Setup the openjdk 8 repo |
| 14 | RUN add-apt-repository ppa:openjdk-r/ppa |
| 15 | |
| 16 | # Install java8 |
| 17 | RUN apt-get update && apt-get install -y openjdk-8-jdk |
| 18 | |
| 19 | # Setup JAVA_HOME, this is useful for docker commandline |
| 20 | ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ |
| 21 | RUN export JAVA_HOME |
| 22 | |
| 23 | # Show java version (for debugging) |
| 24 | # RUN java -version |
| 25 | |
| 26 | RUN apt-get update |
| 27 | RUN apt-get install -y curl |
| 28 | # Install Tomcat |
| 29 | RUN cd /tmp && curl -O https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz |
| 30 | RUN tar -xzf /tmp/apache-tomcat-8.0.37.tar.gz |
| 31 | RUN mv apache-tomcat-8.0.37 /opt |
| 32 | |
| 33 | # Define working directory. |
| 34 | WORKDIR /opt/apache-tomcat-8.0.37/bin |
| 35 | |
| 36 | # Define commonly used ENV variables |
| 37 | ENV PATH $PATH:$JAVA_HOME/bin:/opt/apache-tomcat-8.0.37/bin |
| 38 | |
| 39 | VOLUME /opt/apache-tomcat-8.0.37/logs |
| 40 | |
| 41 | ARG VERSION=${VERSION:-1.1.0} |
| 42 | #LABEL Version=${VERSION} |
| 43 | ARG SDK_DIR=${SDK_DIR} |
| 44 | ARG FE_DIR=${FE_DIR} |
| 45 | ARG PORTAL_SDK_DIR=${PORTAL_SDK_DIR} |
| 46 | ARG PORTAL_DBC_DIR=${PORTAL_DBC_DIR} |
| 47 | # Set up variables: |
| 48 | ENV TOMCATHOME /opt/apache-tomcat-8.0.37 |
| 49 | ENV SDKHOME /PROJECT/APPS/ECOMPPORTAL/ECOMPPORTALAPP |
| 50 | ENV PORTALSDKHOME /PROJECT/APPS/ECOMPPORTAL/ECOMPSDKAPP |
| 51 | ENV PORTALDBCHOME /PROJECT/APPS/ECOMPPORTAL/ECOMPDBCAPP |
| 52 | # Install Common Software,Git,Apache |
| 53 | RUN mkdir -p $SDKHOME && mkdir -p $PORTALSDKHOME && mkdir -p $PORTALDBCHOME |
| 54 | |
| 55 | COPY ${SDK_DIR} ${SDKHOME}/ |
| 56 | COPY ${PORTAL_SDK_DIR} ${PORTALSDKHOME}/ |
| 57 | COPY ${PORTAL_DBC_DIR} ${PORTALDBCHOME}/ |
| 58 | |
| 59 | RUN ln -s ${SDKHOME} ${TOMCATHOME}/webapps/ECOMPPORTAL && ln -s ${PORTALSDKHOME} ${TOMCATHOME}/webapps/ECOMPSDKAPP && ln -s ${PORTALDBCHOME} ${TOMCATHOME}/webapps/ECOMPDBCAPP |
| 60 | |
| 61 | |
| 62 | # Define working directory. |
| 63 | WORKDIR ${TOMCATHOME}/bin |
| 64 | VOLUME ${TOMCATHOME}/logs |
| 65 | # Define commonly used ENV variables |
| 66 | ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin |
| 67 | COPY configure-and-run.sh /PROJECT/OpenSource/UbuntuEP/ |
| 68 | |
| 69 | #RUN cp -r ${FE_DIR}/dist/public ${SDKHOME}/public |
| 70 | |
| 71 | COPY ${FE_DIR}/dist/public ${SDKHOME}/public |
| 72 | # Define default command. |
| 73 | #CMD ["bash"] |
| 74 | CMD ["/PROJECT/OpenSource/UbuntuEP/configure-and-run.sh"] |