FROM bioconductor/devel_core
MAINTAINER Nathan Sheffield <nathan@code.databio.org>
# Updating is required before any apt-gets
RUN sudo apt-get update && apt-get install -y --force-yes\
# Required for R Package XML
libxml2-dev \
# Curl; required for RCurl; but present in upstream images
# libcurl4-gnutls-dev \
# GNU Scientific Library; required by MotIV
libgsl0-dev \
# Open SSL is used, for example, devtools dependency git2r
libssl-dev \
# CMD Check requires to check pdf size
qpdf
# Boost libraries are helpful for some r packages
RUN sudo apt-get update && apt-get install -y --force-yes \
libboost-all-dev
COPY Rprofile .Rprofile
COPY Rsetup/install_fonts.R Rsetup/install_fonts.R
COPY Rsetup/fonts Rsetup/fonts
RUN Rscript Rsetup/install_fonts.R
# Install packages
COPY Rsetup/Rsetup.R Rsetup/Rsetup.R
RUN Rscript Rsetup/Rsetup.R
COPY Rsetup/rpack_basic.txt Rsetup/rpack_basic.txt
COPY Rsetup/rpack_bio.txt Rsetup/rpack_bio.txt
RUN Rscript Rsetup/Rsetup.R --packages=Rsetup/rpack_basic.txt
RUN Rscript Rsetup/Rsetup.R --packages=Rsetup/rpack_bio.txt
# If you want to develop R packages on this machine (need biocCheck):
COPY Rsetup/rpack_biodev.txt Rsetup/rpack_biodev.txt
RUN Rscript Rsetup/Rsetup.R --packages=Rsetup/rpack_biodev.txt
# CMD Check requires to check pdf size
RUN sudo apt-get install -y --force-yes qpdf
# Copy over the stuff in Rpack and add it to path
COPY Rpack/ Rpack/
ENV PATH Rpack:$PATH
user@host$ docker
Commands:
build Build an image from a Dockerfile
commit Create a new image from a container's changes
images List images
info Display system-wide information
ps List containers
pull Pull an image or a repository from a Docker registry server
push Push an image or a repository to a Docker registry server
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
(and lots more)...
bioconductor/release_core
bioconductor/devel_core
bioconductor/release_sequencing
bioconductor/devel_sequencing
1. Containerize R CMD check and BiocCheck
2. Containerize an analysis as a deployable application
3. Maintain a personal/team R container to work from anywhere
roxygenize.sh -i $1
R --no-save <<END
devtools::install_deps("$1");
END
a=$(R CMD build $1)
echo "Building..$a"
# Get the name of the built tarball
regex="building '( .* )'"
[[ $a =~ $regex ]]
name="${BASH_REMATCH[1]}"
echo "R CMD check $name..."
R CMD check $name
echo "R CMD BiocCheck $name..."
R CMD BiocCheck $name
#! /bin/bash
echo $1
docker run -it -v $1:$1 sheffien/rdev bash -c "Rpack.sh $1"
dockrpack.sh $HOME/code/LOLA
Building...
* checking for file ‘/home/nsheffield/code/LOLA/DESCRIPTION’ ... OK
* preparing ‘LOLA’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ‘data/datalist’ file should be added
* building ‘LOLA_0.99.9.tar.gz’
Built tarball: LOLA_0.99.9.tar.gz
R CMD check LOLA_0.99.9.tar.gz...
* using log directory ‘//LOLA.Rcheck’
* using R version 3.2.2 (2015-08-14)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘LOLA/DESCRIPTION’ ... OK
...
R CMD BiocCheck LOLA_0.99.9.tar.gz...
* This is BiocCheck, version 1.5.8.
* BiocCheck is a work in progress. Output and severity of issues may
change.
* Installing package...
* Checking for version number mismatch...
...
Summary:
REQUIRED count: 0
RECOMMENDED count: 0
CONSIDERATION count: 4
# Dockerfile for sheffien/lola
FROM sheffien/rdev
RUN wget http://big.databio.org/regionDB/LOLACoreCaches_latest.tgz
RUN tar -xf LOLACoreCaches_latest.tgz
RUN wget http://big.databio.org/regionDB/lola_vignette_data_150505.tgz
RUN tar -xf lola_vignette_data_150505.tgz
COPY LOLA bin/LOLA
ENTRYPOINT ["LOLA", "-d", "LOLACore/hg19", "-u", "data/activeDHS_universe.bed"]
docker run -v $HOME:/data sheffien/lola -i /data/setA_100.bed -o /data
# Grab the latest Bioc devel image (may take awhile)
docker pull bioconductor/devel_base
# Create and start a container running R (starts instantly!)
docker run --name myR -it bioconductor/devel_base R --save --restore
# Install some new packages, change the environment
> install.packages("data.table")
> biocLite("LOLA")
> variable = 12345
# Now, exit (Ctrl+D) and and view the containers (-n shows stopped)
docker ps -n 5
# start it up again and see your changes
docker start -i myR
# Commit and share!
docker commit -m "Added LOLA" myR sheffien/newrepo
docker images
docker push sheffien/newrepo