OK, the below dockerfile should work and automatically set-up R and Python. I have not tested this specific version, so just send me the error message if it fails, and I will fix it. But, I think it will work. I have only tested this on Ubuntu. With some tweaks this could probably work on Mac. This will not work on Windows. Feel free to ask any questions.
FROM ubuntu:12.04
MAINTAINER Brian Muchmore "brian.muchmore@genyo.es"
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
##Install Java7
RUN apt-get update -y && \
mkdir -p /home/developer && \
apt-get install wget -y && \
apt-get install unzip -y && \
apt-get install libgd2-xpm-dev -y && \
apt-get install libpcre++-dev -y && \
apt-get install python-software-properties -y && \
add-apt-repository ppa:webupd8team/java && \
apt-get update -y && \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt-get install oracle-java7-installer libxext-dev libxrender-dev libxtst-dev -y && \
apt-get install liblzma-dev -y && \
apt-get install libglu1-mesa-dev -y && \
##Get Python working with KNIME. This installs R, so it must be run before the R version you want installed systemwide.
apt-get install python-numpy python-pandas python-protobuf -y && \
##Install R (from source due to no Xserver) with Atlas (OpenBLAS doesn't seem to play nice with library(parallel)) and many downstream dependencies
apt-get install curl libcurl4-openssl-dev build-essential libreadline6 libreadline6-dev libcairo2-dev libpango1.0-dev xorg-dev tk8.5 -y && \
apt-get install gcc make gfortran g++ tk tk-dev tcl tcl-dev libcairo2 libjpeg8 libtiff4 libxml2-dev liblz-dev libicu-dev libicu48 libssh2-1 -y && \
apt-get install libhdf5-serial-dev liblz1 libtiff4-dev libtiff-tools libtiffxx0c2 libtiff-opengl libghc-bzlib-dev libgtk2.0-dev libghc-bzlib-dev -y && \
wget https://cran.r-project.org/src/base/R-3/R-3.2.1.tar.gz --no-check-certificate -O /tmp/R.tar.gz -q && \
tar -xf /tmp/R.tar.gz -C /home/developer && \
rm /tmp/R.tar.gz && \
cd /home/developer/R-3.2.1 && \
./configure --with-recommended-packages=no --without-x --with-tcltk --with-aqua --with-ICU --with-cairo --with-libpng --with-libtiff --with-jpeglib --enable-R-shlib --enable-BLAS-shlib --enable-memory-profiling && \
make && \
make check && \
make install && \
apt-get install libatlas3gf-base liblapack3gf -y && \
##Download KNIME and get the KNIME browser working
wget http://www.knime.org/knime_downloads/linux/knime-latest-linux.gtk.x86_64.tar.gz -O /tmp/knime.tar.gz -q && \
echo 'Installing knime' && \
tar -xf /tmp/knime.tar.gz -C /home/developer && \
rm /tmp/knime.tar.gz && \
apt-get install libwebkitgtk-1.0-0 -y && \
##Install whatever KNIME extensions you want. The below is just used as an example and installs Python and R nodes.
cd /home/developer/knime_2.12.0 && \
./knime -clean -purgeHistory -application org.eclipse.equinox.p2.director -noSplash -repository http://update.knime.org/analytics-platform/2.12 -installIUs org.knime.python.nodes -installIUs org.knime.features.r.feature.group -vmargs -Declipse.p2.mirrors=true -Djava.net.preferIPv4Stack=true && \
##Get the correct verion of R working with KNIME and put KNIME in expert mode.
R CMD javareconf && \
echo '/usr/local/lib/R/lib/' > /etc/ld.so.conf.d/libR.conf && \
ldconfig && \
echo '-Djava.library.path=/usr/local/lib/R/library/jri/' >> /home/developer/knime_2.12.0/knime.ini && \
echo '-Dknime.expert.mode=true' >> /home/developer/knime_2.12.0/knime.ini && \
echo 'chooseCRANmirror(ind=73)' > /home/developer/packages.R && \
echo 'install.packages("rJava")' >> /home/developer/packages.R && \
Rscript /home/developer/packages.R && \
##Set up user priviliges and share X11 socket
apt-get install sudo -y && \
mkdir -p /etc/sudoers.d && \
chmod +x /home/developer/knime_2.12.0 && \
echo "developer:x:1000:1000:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:1000:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown developer:developer -R /home/developer && \
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
USER developer
ENV HOME /home/developer
WORKDIR /home/developer
CMD /home/developer/knime_2.12.0/knime -data /home/developer/knime-workspace