KNIME in docker?

Hi all,

Do you have a docker image containing KNIME Analytics Platform? (Preferably with an option to connect to it with ssh -X or vnc, so to use it with GUI.) I would like to introduce KNIME in a meetup and would be nice to share with them an easy to use, preset solution (like the webkit preinstalled, R with the correct version etc).

Thanks, gabor

1 Like

I am not aware of anything, but what we do internally is use the pre-packaged monolithic distributions from our download site, and burn these to a USB stick along with a zipped workspace tailored to the course. If you end up with a docker image though, do post back here as that sounds interesting...

Cheers, Aaron

 

Hi Aaron,

I have created a really prototypical image. I would not see it as a huge success, from (HTML5) VNC it is not so nice, the UI practically unusable (though visible). Probably I'll try something more stripped down as this is currently -unnecessarily- very large. Anyway if someone would like to experiment with docker and KNIME, this might be a good starting point towards that (apt-get install from it though is a bit slow from Europe, as the base image set the source list to tw (Taiwan) mirror.) Probably with SSH one might get a better user experience.

If someone with docker experience can create a good (public) dockerfile with KNIME, please keep me posted.

Thanks, gabor

Gabor, have you looked into this further?  It is a good idea.

-Brian Muchmore

No, unfortunately I had no time for that (and I am not planning to present KNIME in the near future, so less motivation). I think it would be nice to have a simple way to set up an environment for repeatable analysis, that is why I started it, but had some problems with the UI (I guess it were easier to set up a KNIME server if it were free), that seemed not trivial to solve. Maybe just a different base were fix it, but currently I am working on other things.

Aaron,

How do I download KNIME using wget or curl?  I ask because I am trying to make a Dockerfile for KNIME.

-Brian

Brian,

I would use the following link: https://www.knime.org/knime_downloads/linux/knime-full-latest-linux.gtk.x86_64.tar.gz (which includes all free extensions) or http://www.knime.org/knime_downloads/linux/knime-latest-linux.gtk.x86_64.tar.gz (only KNIME without extensions) with this md5 sum: https://www.knime.org/knime_downloads/linux/knime-full-latest-linux.gtk.x86_64.tar.gz.md5 or with this: http://www.knime.org/knime_downloads/linux/knime-latest-linux.gtk.x86_64.tar.gz.md5

I hope this will not change with the release of 2.12.

Thanks, gabor

PS.: There might be better links. In case this deep linking is not suggested, I apologise. Probably there is a link which does not contain a JRE, though in case a JRE was not installed in the Dockerfile, this might be a useful feature.

Thanks, Gabor, that is what I needed.  I will respond back when/if I get something working.  I know it is possible, but I am new to Docker, so it will take me time to get it right.

-Brian

I have KNIME running inside a docker container by sharing the x11 socket with the local ubuntu installation (I used parts of this to get it working https://github.com/fgrehm/docker-eclipse/blob/master/Dockerfile).  It seems to work well, and with some extra packages this should work on Mac and Windows as well. 

fontconfig-infinality
fontconfig-infinality

But, when I double click into a node, the fonts look terrible.  Only the node fonts look bad.  Does anyone have any suggestions?  I have tried installing various font packages (e.g. xfonts-75dpi, xfonts-100dpi, cairo etc), but that has not fixed the problem.

-Brian

bmuchmore: Hello, could you perhaps share the Dockerfile you used to build your KNIME-in-docker ? I am trying to add KNIME as a dependency to my docker image (trying to link KNIME with galaxy, an experiment let's say) so I would love to avoid some beginner's mistakes. I am new to docker concept, though I already like it a lot.

 

Thanks!

Piotr

Yes, I would be happy to, but it will take me a day or two.  If it is longer than that though, please feel free to remind me because I may forget.

-Brian

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

 

1 Like

A post was split to a new topic: Run KNIME from a docker