BootStrap: docker
From: rocker/r-base:4.2.3

%post
    cd /tmp
    #export http_proxy=...
    #echo 'Acquire::http::Proxy "http://xxxx.xx.xx:xxxx";' >> /etc/apt/apt.conf
    apt-get -y update
    apt-get install -y build-essential curl cmake perl libncurses-dev libbz2-dev liblzma-dev tar wget bzip2 gcc zlib1g-dev make libxml2-dev libcurl4-openssl-dev postgresql libpq-dev libnode-dev libssl-dev  libclang-dev gdebi-core cargo libudunits2-dev libmagick++-dev evince xdvik-ja libpoppler-cpp-dev xorg libx11-dev libglu1-mesa-dev --fix-missing
    wget https://github.com/samtools/samtools/releases/download/1.12/samtools-1.12.tar.bz2
    tar xvjf samtools-1.12.tar.bz2  --no-same-owner
    cd samtools-1.12/
    ./configure
    make
    make install
    cd ..
    rm samtools-1.12.tar.bz2
    R --no-echo -e 'install.packages(c("cli", "sys", "glue", "crayon", "lifecycle", "magrittr", "rlang", "stringi", "vctrs", "generics","fansi", "pillar", "utf8", "R6"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("pkgconfig", "hms", "remotes", "prettyunits", "progress", "clipr", "hms", "tibble", "bit", "bit64", "withr", "tidyselect", "cpp11", "tzdb", "vroom", "readr"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("backports", "dplyr", "purrr", "stringr", "tidyr"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    #R --no-echo -e 'install.packages(c("assertthat", "arrow", "digest", "jsonlite", "broom", "fastmap", "cachem", "memoise", "conflicted", "blob", "lazyeval", "rex", "curl", "mime", "openssl", "httr", "yaml", "covr"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    #R --no-echo -e 'install.packages(c("tidyverse"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("generics", "timechange", "lubridate", "R.oo", "R.methodsS3"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("askpass", "formatR", "lambda.r", "futile.options", "futile.logger", "snow", "codetools"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("httr", "curl", "jsonlite", "mime","openssl"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'install.packages(c("R.utils", "BiocManager", "bitops"), dependencies = FALSE, repos="https://cloud.r-project.org/")'
    R --no-echo -e 'BiocManager::install(c("zlibbioc", "RCurl", "BH", "S4Vectors", "BiocGenerics", "IRanges", "XVector", "GenomeInfoDb", "GenomeInfoDbData", "BiocParallel"), update=FALSE)'
    R --no-echo -e 'BiocManager::install(c("Rhtslib", "BiocStyle", "Rsamtools", "GenomicRanges", "Biostrings", "GenomicAlignments"), update=FALSE)'
    R --no-echo -e 'options(timeout = 3000); BiocManager::install("BSgenome.Hsapiens.UCSC.hg38", update=FALSE)'
    R --no-echo -e 'remotes::install_github("MANO-B/MicroSEC")'

%environment
export PATH=/usr/local/bin:$PATH
export LC_ALL=C.UTF-8
