LoginSignup
10

More than 5 years have passed since last update.

Bioconductorのパッケージ開発環境を作るためのDockerfile

Last updated at Posted at 2015-03-06

Dockerfileを置いて、

boot2docker start # Macの場合
docker pull ubuntu
docker build -t ubuntu:latest . # Dockerfileをもとにビルド
docker run -it $(docker images -q | head -1) /bin/bash # 一番最近作ったdocker imageを起動

とするだけ。

↓ Dockerfileの中身↓

FROM ubuntu

MAINTAINER KOKI TSUYUZAKI

RUN sudo apt-get -y update
RUN sudo apt-get -y upgrade
RUN sudo apt-get -y build-dep r-base
RUN sudo apt-get -y install subversion ccache r-base-dev
RUN mkdir -p ~/svn
RUN cd ~/svn && svn co https://svn.r-project.org/R/trunk r-devel/R
RUN cd ~/svn/r-devel/R && sudo ./configure --without-recommended-packages --enable-R-shlib && sudo make && sudo make install
ENV PATH $PATH:~/svn/r-devl/R/bin
RUN sudo apt-get -y install libxml2-dev r-cran-xml libcurl3-gnutls-dev
RUN apt-get -y install wget
RUN wget http://cran.r-project.org/src/contrib/XML_3.98-1.1.tar.gz
RUN wget http://cran.r-project.org/src/contrib/bitops_1.0-6.tar.gz
RUN wget http://cran.r-project.org/src/contrib/RCurl_1.95-4.5.tar.gz
RUN R CMD INSTALL XML_3.98-1.1.tar.gz
RUN R CMD INSTALL bitops_1.0-6.tar.gz
RUN R CMD INSTALL RCurl_1.95-4.5.tar.gz
RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite(c("BiocInstaller", "AnnotationDbi", "DBI", "RSQLite", "IRanges", "Biobase", "S4Vectors", "BiocGenerics"), ask=FALSE); \
install.packages(c("RUnit", "codetools", "MASS", "lattice", "Matrix", "nlme", "survival", "boot", "cluster", "foreign", "KernSmooth", "rpart", "class", "nnet", "spatial", "mgcv"), repos="http://cran.ism.ac.jp/")'

rockerのr-develを使えば同じことはできるっぽい(2015/3/20 更新)。

MeSH関連パッケージ(meshr, MeSHDbi, MeSH.db, MeSH.AOR.db, MeSH.PCR.db, 120のMeSH.XXX.eg.db型パッケージ)が入ったものを作りたい場合は、Docker containers for Bioconductorのdevel_coreを使って、こんな感じにした。
たくさんのRパッケージをインストールするとき、一個でもコケると最初からやり直しなので、10パッケージずつでRUNにした(2015/3/20 更新)。

↓ Dockerfileの中身↓

FROM bioconductor/devel_core

MAINTAINER KOKI TSUYUZAKI

RUN sudo apt-get -y update && sudo apt-get -y clean
RUN sudo apt-get -y upgrade && sudo apt-get -y clean
RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("meshr", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Aga.PEST.eg.db", ask=FALSE); \
biocLite("MeSH.Ame.eg.db", ask=FALSE); \
biocLite("MeSH.Aml.eg.db", ask=FALSE); \
biocLite("MeSH.Ani.FGSC.eg.db", ask=FALSE); \
biocLite("MeSH.Ath.eg.db", ask=FALSE); \
biocLite("MeSH.Bfl.eg.db", ask=FALSE); \
biocLite("MeSH.Bsu.RONN1.eg.db", ask=FALSE); \
biocLite("MeSH.Bsu.TUB10.eg.db", ask=FALSE); \
biocLite("MeSH.Bsu.Bsn5.eg.db", ask=FALSE); \
biocLite("MeSH.Bsu.W23.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Bta.eg.db", ask=FALSE); \
biocLite("MeSH.Cal.SC5314.eg.db", ask=FALSE); \
biocLite("MeSH.Cbr.eg.db", ask=FALSE); \
biocLite("MeSH.Cel.eg.db", ask=FALSE); \
biocLite("MeSH.Cfa.eg.db", ask=FALSE); \
biocLite("MeSH.Cin.eg.db", ask=FALSE); \
biocLite("MeSH.Cja.eg.db", ask=FALSE); \
biocLite("MeSH.Cpo.eg.db", ask=FALSE); \
biocLite("MeSH.Cre.eg.db", ask=FALSE); \
biocLite("MeSH.Dan.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Dda.3937.eg.db", ask=FALSE); \
biocLite("MeSH.Ddi.AX4.eg.db", ask=FALSE); \
biocLite("MeSH.Der.eg.db", ask=FALSE); \
biocLite("MeSH.Dgr.eg.db", ask=FALSE); \
biocLite("MeSH.Dme.eg.db", ask=FALSE); \
biocLite("MeSH.Dmo.eg.db", ask=FALSE); \
biocLite("MeSH.Dpe.eg.db", ask=FALSE); \
biocLite("MeSH.Dre.eg.db", ask=FALSE); \
biocLite("MeSH.Dse.eg.db", ask=FALSE); \
biocLite("MeSH.Dsi.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Dvi.eg.db", ask=FALSE); \
biocLite("MeSH.Dya.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O111.H.11128.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O26.H11.11368.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O103.H2.12009.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.536.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O127.H6.E2348.69.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.55989.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.CFT073.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.S88.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Eco.IAI39.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.APEC01.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.B.REL606.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O26.H7.CB9615.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.E24377A.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.HS.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.IAI1.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.KO11FL.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.SMS35.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Eco.K12.MG1655.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.SE11.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.UTI89.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.UMN026.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.BW2952.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.K12.DH10B.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.ED1a.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O157.H7.EC4115.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O157.H7.EDL933.eg.db", ask=FALSE); \
biocLite("MeSH.Eqc.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Eco.O157.H7.Sakai.eg.db", ask=FALSE); \
biocLite("MeSH.Eco.O157.H7.TW14359.eg.db", ask=FALSE); \
biocLite("MeSH.Gga.eg.db", ask=FALSE); \
biocLite("MeSH.Gma.eg.db", ask=FALSE); \
biocLite("MeSH.Laf.eg.db", ask=FALSE); \
biocLite("MeSH.Lma.eg.db", ask=FALSE); \
biocLite("MeSH.Mdo.eg.db", ask=FALSE); \
biocLite("MeSH.Mga.eg.db", ask=FALSE); \
biocLite("MeSH.Mml.eg.db", ask=FALSE); \
biocLite("MeSH.Mmu.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Mtr.eg.db", ask=FALSE); \
biocLite("MeSH.Nle.eg.db", ask=FALSE); \
biocLite("MeSH.Oan.eg.db", ask=FALSE); \
biocLite("MeSH.Ocu.eg.db", ask=FALSE); \
biocLite("MeSH.Oni.eg.db", ask=FALSE); \
biocLite("MeSH.Osa.eg.db", ask=FALSE); \
biocLite("MeSH.Pab.eg.db", ask=FALSE); \
biocLite("MeSH.Pae.PAO1.eg.db", ask=FALSE); \
biocLite("MeSH.Pae.LESB58.eg.db", ask=FALSE); \
biocLite("MeSH.Pae.PA7.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Pae.PA14.eg.db", ask=FALSE); \
biocLite("MeSH.Pfa.3D7.eg.db", ask=FALSE); \
biocLite("MeSH.Pto.eg.db", ask=FALSE); \
biocLite("MeSH.Ptr.eg.db", ask=FALSE); \
biocLite("MeSH.Rno.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.Mu50.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.Mu3.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.MSSA476.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.COL.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.ED98.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Sau.USA300FPR3757.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.MRSA252.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.M013.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.Newman.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.RF122.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.MSHR1132.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.USA300TCH1516.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.N315.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.VC40.eg.db", ask=FALSE); \
biocLite("MeSH.Sau.MW2.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Sce.S288c.eg.db", ask=FALSE); \
biocLite("MeSH.Sco.A32.eg.db", ask=FALSE); \
biocLite("MeSH.Spo.972h.eg.db", ask=FALSE); \
biocLite("MeSH.Spu.eg.db", ask=FALSE); \
biocLite("MeSH.Ssc.eg.db", ask=FALSE); \
biocLite("MeSH.Tbr.9274.eg.db", ask=FALSE); \
biocLite("MeSH.Tgo.ME49.eg.db", ask=FALSE); \
biocLite("MeSH.Tgu.eg.db", ask=FALSE); \
biocLite("MeSH.Vvi.eg.db", ask=FALSE); \
biocLite("MeSH.Xla.eg.db", ask=FALSE)'

RUN R -e 'source("http://bioconductor.org/biocLite.R"); \
biocLite("MeSH.Xtr.eg.db", ask=FALSE); \
biocLite("MeSH.Zma.eg.db", ask=FALSE); \
biocLite("MeSH.Miy.eg.db", ask=FALSE); \
biocLite("MeSH.Mes.eg.db", ask=FALSE); \
biocLite("MeSH.Ana.eg.db", ask=FALSE); \
biocLite("MeSH.Sil.eg.db", ask=FALSE)'

[参考]
Dockerfile の書き方「私的」なベストプラクティス
Best practices for writing Dockerfiles 日本語訳(仮)

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10