FROM postgres:10 ENV POSTGRES_USER pluto ENV POSTGRES_PASSWORD power$$14 ENV POSTGRES_DB pluto 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 8u171 # 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/ stretch main contrib non-free' > /etc/apt/sources.list.d/stretch.list && \ echo 'deb http://ftp.se.debian.org/debian/ stretch-backports main contrib non-free' > /etc/apt/sources.list.d/stretch-backports.list && \ apt-get update && \ apt-get install -y --no-install-recommends \ openjdk-8-jdk-headless \ ca-certificates-java \ ca-certificates \ openssl \ wget \ libapr1-dev \ coreutils \ dpkg-dev dpkg \ gcc \ libc-dev \ make \ libssl1.0.2 \ libssl-dev \ apache2 ;\ rm -rf /var/lib/apt/lists/* #RUN apt-mark auto libssl1.0.0 # set default java version RUN update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64 # 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 RUN apt-get update && apt-get install -y apt-transport-https ca-certificates #RUN echo "deb [trusted=yes] https://eddelbuettel.github.io/drr35/ ./" > /etc/apt/sources.list.d/debian-r-3.5.list RUN echo "deb [trusted=yes] https://cloud.r-project.org/bin/linux/debian stretch-cran35/" > /etc/apt/sources.list.d/debian-r-3.5.list ENV R_BASE_VERSION 3.5.0 # 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 telnet ## Now install R and littler, and create a link for littler in /usr/local/bin ## Also set a default CRAN repo, and make sure littler knows about it too ## NB '-t unstable' paused to allow drr35 repo to supply current ones RUN apt-get update \ && apt-get install -y \ littler \ r-cran-littler \ r-base=${R_BASE_VERSION}-* \ r-base-dev=${R_BASE_VERSION}-* \ r-recommended=${R_BASE_VERSION}-* \ && echo 'options(repos = c(CRAN = "https://cloud.r-project.org/"), download.file.method = "libcurl")' >> /etc/R/Rprofile.site \ && echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \ && ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \ && ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \ && ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \ && ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \ && install.r docopt \ && rm -rf /tmp/downloaded_packages/ /tmp/*.rds \ && rm -rf /var/lib/apt/lists/* # RUN echo "install.packages('Rserve')" | R --save RUN echo "install.packages('Rserve',,'http://www.rforge.net/')" | R --save RUN apt-get update && apt-get install libcurl4-openssl-dev RUN R -e "install.packages('heatmaply')" RUN R -e "install.packages('irlba')" # uses to convert sh scripts created on Windows OS or building container under Windows OS RUN apt-get update && apt-get install -y dos2unix RUN set -e \ && mkdir -p /usr/local/pluto/distrib WORKDIR /usr/local/pluto VOLUME /usr/local/pluto/distrib EXPOSE 80 EXPOSE 22 EXPOSE 443 EXPOSE 6311 ENV BASE_HREF - ENV VERSION 1 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 && dos2unix /opt/install.sh && 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 target/worker.jar /usr/local/pluto/worker.jar ADD assets/initial.postgresql.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