Make Docker image File with Chemoinformatics toolkits.

Docker https://www.docker.com is an open platform for distributed applications for developers and sysadmins.
Providing docker image that means every one build same environment easily.
It’s means create own image and share image.
Docker provide container.
Containers running on a single machine all share the same OS kernel.
It’s difference of normal VM.
I used docker before but I have not written my own image, so today I wrote Dockerfile for test.
At first I build docker env in my pc using homebrew.

brew cask install virtualbox
brew install docker
brew install boot2docker

After installed, start up docker.
And I started up a Docker instance.(ubuntu)

boot2docker init
boot2docker up
docker run -i -t ubuntu /bin/bash

OK.
Next I wrote Docker file based on ubuntu.
Recent version of ubuntu, user can install RDKit using apt-get command (2015 03 01 for wily).
So, Dockerfile is following.
Following image will provide user RDKit, and some chemoinformatics apps.

from ubuntu

MAINTAINER iwatobipen

RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install python-pip python-dev build-essential
RUN pip install --upgrade pip
RUN apt-get -y install wget
RUN apt-get -y install python-pillow
RUN apt-get -y install python-numpy python-scipy python-patsy python-statsmodels
RUN apt-get -y install python-rdkit librdkit1 rdkit-data rdkit-doc
RUN apt-get -y install python-scikits-learn python-pandas python-pandas-lib
RUN apt-get -y install python-matplotlib python-matplotlib-data
RUN pip install seaborn
RUN pip install tornado
RUN apt-get -y install ipython

After save the file.
Build image using following command.

iwatobipen$ docker build -t iwatobipen/rdkit-ubuntu:0.1 .

Wow I could docker image!
Next I push the image to dockerhub.

iwatobipen$ docker login
..............
Login Succeeded
iwatobipen$ docker push iwatobipen/rdkit-ubuntu
The push refers to a repository [docker.io/iwatobipen/rdkit-ubuntu] (len: 2)
33e1d12d46e0: Pushed 
.......
size: 28540

Result is following URL 😉
https://hub.docker.com/r/iwatobipen/rdkit-ubuntu/
OK, Run the image.

iwatobipen$ docker run -i -t iwatobipen/rdkit-ubuntu /bin/bash
root@c644a9d6f0c6:/# 

Logged in…
Use ipython.

root@c644a9d6f0c6:/# ipython
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from rdkit import rdBase

In [2]: rdBase.rdkitVersion
Out[2]: '2013.09.1'

Oops! mistake…
I used old version of ubuntu….;-(

docker run -i -t ubuntu:15.10 /bin/bash

Then build Docker file.
Using “from ubuntu:15.10” instead of “from ubuntu15:10”.

Then tag the image.

iwatobipen$ docker tag c053137912aa iwatobipen/rdkit-ubuntu15
iwatobipen$ docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
iwatobipen/rdkit-ubuntu15   0.1                 c053137912aa        6 minutes ago       841.3 MB
iwatobipen/rdkit-ubuntu15   latest              c053137912aa        6 minutes ago       841.3 MB
iwatobipen/rdkit-ubuntu     0.1                 33e1d12d46e0        24 hours ago        701.6 MB
iwatobipen/rdkit-ubuntu     latest              33e1d12d46e0        24 hours ago        701.6 MB
<none>                      <none>              0221cd7430fb        24 hours ago        494.8 MB
ubuntu                      latest              e9ae3c220b23        5 days ago          187.9 MB
pacur/ubuntu-wily           latest              f4e4eb1c359e        2 weeks ago         859.9 MB
ubuntu                      15.10               5eb72b199374        3 weeks ago         131.4 MB
iwatobipen$ docker run -i -t iwatobipen/rdkit-ubuntu15
root@f192406f11ba:/# ipython
Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from rdkit import Chem

In [2]: from rdkit import rdBase

In [3]: rdBase.rdkitVersion  
Out[3]: '2015.03.1'

Good, and push docker hub.
Results is here.
https://hub.docker.com/r/iwatobipen/rdkit-ubuntu15/
It’s fun!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s