FROM mysql:5 #ENV MYSQL_ROOT_HOST % ENV MYSQL_ROOT_PASSWORD power$ ENV MYSQL_DATABASE pluto ENV MYSQL_USER pluto ENV MYSQL_PASSWORD powerS14 RUN apt-get update && apt-get install -y --no-install-recommends \ bzip2 \ unzip \ xz-utils \ && rm -rf /var/lib/apt/lists/* # Default to UTF-8 file.encoding ENV LANG C.UTF-8 # add a simple script that can auto-detect the appropriate JAVA_HOME value # based on whether the JDK or only the JRE is installed RUN { \ echo '#!/bin/sh'; \ echo 'set -e'; \ echo; \ echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \ } > /usr/local/bin/docker-java-home \ && chmod +x /usr/local/bin/docker-java-home # do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe RUN ln -svT "/usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)" /docker-java-home ENV JAVA_HOME /docker-java-home ENV JAVA_VERSION 8u131 ENV JAVA_DEBIAN_VERSION 8u131-b11-1~bpo8+1 # see https://bugs.debian.org/775775 # and https://github.com/docker-library/java/issues/19#issuecomment-70546872 ENV CA_CERTIFICATES_JAVA_VERSION 20161107~bpo8+1 # deal with slim variants not having man page directories (which causes "update-alternatives" to fail) RUN set -ex; \ if [ ! -d /usr/share/man/man1 ]; then \ mkdir -p /usr/share/man/man1; \ fi; \ echo 'deb http://ftp.se.debian.org/debian/ jessie main contrib non-free' > /etc/apt/sources.list.d/jessie.list && \ echo 'deb http://ftp.se.debian.org/debian/ jessie-backports main contrib non-free' > /etc/apt/sources.list.d/jessie-backports.list && \ apt-get update && \ apt-get install -y --no-install-recommends \ openjdk-8-jdk-headless="$JAVA_DEBIAN_VERSION" \ ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ ca-certificates \ openssl \ wget="1.16-1+deb8u4" \ libapr1-dev \ coreutils \ dpkg-dev dpkg \ gcc \ libc-dev \ make \ libssl1.0.0="1.0.2l-1~bpo8+1" \ libssl-dev="1.0.2l-1~bpo8+1" \ apache2 ;\ rm -rf /var/lib/apt/lists/* # verify that "docker-java-home" returns what we expect # update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java # ... and verify that it actually worked for one of the alternatives we care about RUN set -ex; \ apt-get purge -y openjdk-7-jre-headless ; \ [ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \ update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \ update-alternatives --query java | grep -q 'Status: manual' # see CA_CERTIFICATES_JAVA_VERSION notes above RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure # If you're reading this and have any feedback on how this image could be # improved, please open an issue or a pull request so we can discuss it! # # https://github.com/docker-library/openjdk/issues ENV DEBIAN_FRONTEND noninteractive RUN set -e \ && apt-get update \ && apt-get install -y --no-install-recommends supervisor sasl2-bin vim mc rsyslog \ build-essential libssl-dev curl RUN set -e \ && mkdir -p /usr/local/pluto/distrib WORKDIR /usr/local/pluto VOLUME /usr/local/pluto/distrib EXPOSE 80 EXPOSE 22 EXPOSE 443 ENV BASE_HREF - ADD assets/install.sh /opt/install.sh ADD assets/deploy.sh /usr/local/pluto/deploy.sh ADD assets/000-default.conf /etc/apache2/sites-available/000-default.conf RUN set -e && a2enmod proxy && a2enmod proxy_http && a2enmod rewrite && chmod 755 /opt/install.sh && chmod 755 /usr/local/pluto/deploy.sh && ls -l /opt ADD target/front.zip /usr/local/pluto/distrib/front.zip ADD target/Pluto-0.0.1-SNAPSHOT.jar /usr/local/pluto/Pluto.jar ADD assets/mysql/initial.sql /docker-entrypoint-initdb.d/initial.sql ADD target/conf /usr/local/pluto/conf RUN unzip distrib/*.zip -d front CMD /opt/install.sh; /usr/bin/supervisord -c /etc/supervisor/supervisord.conf