How to create a PennCNV Docker image

Dockerfile can be built by using 'docker build -t image-name tag-value' from within the folder that the Dockerfile is saved in. The choice of image name and tag value is up to you. The first time you build the image it can take anything between 5-20 minutes, depending internet connection and CPU power. Note that after the building process some manual changes need to be made to complete the image. Detailed instructions can be found here.

Explanation of Dockerfile:
  1. start with ubuntu as base image as it has interactive shell and is compatible to all packages
  2. update apt-get and install build-essential (CPAN), gcc-4.9 (for compilation of PennCNV), wget (downloading files), nano (to modify text files)
  3. download and install perlbrew
  4. add perlbrew to PATH so it can be called
  5. install perl-5.8.9 through perlbrew
  6. add perl-5.8.9 to PATH so it is being used when calling 'perl'
  7. download PennCNV and the additional Affy files and untar both packages to /root/PennCNV-1.0.3 (afterwards delete tar files)
  8. duplicate hhall.hmm and change the copy's name to hhall_LOH.hmm
  9. add PennCNV and Affy scripts to PATH
  10. until here, everything is done by the build-command automatically, but the last changes need to be made manually:
    1. run image in interactive mode ('run -it')
    2. use nano to change value '100' in B1_mean to '0' in /root/PennCNV-1.0.3/lib/hhall_LOH.hmm
    3. use nano to change 'gcc' in PennCNV's /root/PennCNV-1.0.3/kext/Makefile to 'gcc-4.9' (two occasions)
    4. compile PennCNV by calling 'make' in '/root/PennCNV-1.0.3/kext'
    5. type 'exit' to leave the container
  11. after the manual changes, commit them to the image:
    1. type 'docker ps -a' to get a list of all containers you have used
    2. copy the name of the container you just made the changes to, might look like this: 81e767b30eca
    3. then commit the changes through 'docker commit 81e767b30eca image-name'

FROM ubuntu
RUN apt-get update && apt-get install -y build-essential gcc-4.9 wget nano
RUN wget -O - | bash
ENV PATH /root/perl5/perlbrew/bin:$PATH
RUN perlbrew install --notest perl-5.8.9 --thread --multi -D useshrplib
ENV PATH /root/perl5/perlbrew/perls/perl-5.8.9/bin:$PATH
RUN wget -O /tmp/penncnv.tar.gz
RUN wget -O /tmp/gw6.tar.gz
RUN tar -xvzf /tmp/penncnv.tar.gz -C /root
RUN tar -xvzf /tmp/gw6.tar.gz -C /root/PennCNV-1.0.3
RUN rm /tmp/penncnv.tar.gz /tmp/gw6.tar.gz
RUN cp /root/PennCNV-1.0.3/lib/hhall.hmm /root/PennCNV-1.0.3/lib/hhall_LOH.hmm
ENV PATH /root/PennCNV-1.0.3:/root/PennCNV-1.0.3/gw6/bin:$PATH
# now manually edit PennCNV's Makefile, copy hhall.hmm to hhall_LOH.hmm and change 100 to 0 for LOH analysis
# then 'make' PennCNV
Topic revision: r4 - 23 Sep 2016, MichaelBaudis
Michael Baudis