Skip to content
Snippets Groups Projects
Commit f2d16dbd authored by Sascha Meiers's avatar Sascha Meiers
Browse files

New docker file + routine to create singularity image from Dockerfile

(works on my computer).

This allows me to more rapidly develp the Dockerfile. Also this commit
includes a separate conda environment which is going to be used within
singularity
parent 822a7829
No related branches found
No related tags found
No related merge requests found
FROM rocker/r-ver:3.4.3
MAINTAINER Sascha Meiers meiers@embl.de
LABEL version="1.1"
LABEL mosaicatcher_version="0.3.1-dev"
# LABEL strandphaser_version="24eabf99a15c2ab959f7c5667cc22ef994cd0fc5"
LABEL strandphaser_version="8011371c3a2f2d3a92116eb9df657b42d0b5e5b4"
LABEL description="Required software dependencies for the MosaiCatcher pipeline (https://github.com/friendsofstrandseq/pipeline) to be used from within Snakemake."
# Install basic required packages
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
libssl-dev \
libcurl4-openssl-dev \
libboost-program-options1.62.0 \
libboost-program-options1.62-dev \
libboost-random1.62-dev \
libboost-system1.62.0 \
libboost-system1.62-dev \
libboost-filesystem1.62.0 \
libboost-filesystem1.62-dev \
libboost-iostreams1.62.0 \
libboost-iostreams1.62-dev \
libboost-date-time1.62.0 \
libboost-date-time1.62-dev \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libxml2-dev \
gawk \
bcftools=1.3.1-1+b1 \
samtools=1.3.1-3 \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s $(which python3) /usr/local/sbin/python
# Install basic R packages from a fixed R version (MRAN)
RUN Rscript -e "install.packages(c( \
'assertthat', \
'dplyr', \
'data.table', \
'stringr', \
'ggplot2', \
'cowplot', \
'devtools', \
'reshape2', \
'doParallel', \
'foreach'))"
# Install StrandPhaseR
RUN Rscript -e "source('http://bioconductor.org/biocLite.R'); \
biocLite('BSgenome', ask=F); \
biocLite('BSgenome.Hsapiens.UCSC.hg38', ask=F); \
devtools::install_github('daewoooo/StrandPhaseR@8011371c3a2f2d3a92116eb9df657b42d0b5e5b4', dependencies = NA);" \
&& rm -rf /usr/local/lib/R/site-library/BSgenome.Hsapiens.UCSC.hg38/extdata/single_sequences.2bit
# Install FreeBayes
RUN apt-get update \
&& BUILD_DEPS="git" \
&& apt-get install --no-install-recommends -y $BUILD_DEPS \
&& git clone --recursive git://github.com/ekg/freebayes.git \
&& cd freebayes \
&& make \
&& cd \
&& ln -s /freebayes/bin/freebayes /usr/local/sbin/freebayes \
&& apt-get remove -y $BUILD_DEPS \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install MosaiCatcher (and clean up afterwards)
RUN apt-get update \
&& BUILD_DEPS="cmake \
git" \
&& apt-get install --no-install-recommends -y $BUILD_DEPS \
&& git clone https://github.com/friendsofstrandseq/mosaicatcher.git \
&& cd mosaicatcher \
&& git checkout 0.3.1-dev \
&& mkdir build \
&& cd build \
&& cmake ../src/ \
&& cmake --build . \
&& cd \
&& ln -s /mosaicatcher/build/mosaic /usr/local/sbin/mosaic \
&& apt-get remove -y $BUILD_DEPS \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies for python scripts
ENV PATH="${PATH}:/miniconda/bin"
RUN apt-get update \
&& BUILD_DEPS="wget \
bzip2" \
&& apt-get install --no-install-recommends -y $BUILD_DEPS \
&& wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& chmod +x Miniconda3-latest-Linux-x86_64.sh \
&& ./Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda \
&& rm -rf Miniconda3-latest-Linux-x86_64.sh \
&& conda install \
scipy=1.1.0 \
pandas=0.23.4 \
&& conda clean --all \
&& apt-get remove -y $BUILD_DEPS \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN conda create -n mosaic-env scipy=1.1.0 numpy=1.15.4 pandas=0.23.4
Bootstrap: docker
Registry: http://localhost:5000
Namespace:
From: mosaic:dev
#!/bin/bash
imgname=mosaic
echo "[d2s] Starting a local docker registry ..."
docker run -d -p 5000:5000 --restart=always --name registry registry:2
echo -e "\n"
echo "[d2s] Build Docker image from Dockerfile ..."
docker build -t ${imgname}:dev --network host .
echo -e "\n"
echo "[d2s] Tag newly build image to local registry ..."
docker tag ${imgname}:dev localhost:5000/${imgname}
echo -e "\n"
echo "[d2s] Push newly build image to local registry ..."
docker push localhost:5000/${imgname}
echo -e "\n"
echo "[d2s] Build singularity image file from Docker image ..."
SINGULARITY_NOHTTPS=1 singularity build ${imgname}.simg docker://localhost:5000/${imgname}
echo -e "\n"
echo "[d2s] Stop local registry ..."
docker container stop registry
echo -e "\n"
echo "[d2s] Remove registry container ..."
docker container ls -aqf name=registry | xargs docker rm
name: mosaic
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- numpy=1.15.4
- pandas=0.23.4
- scipy=1.1.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment