anchor.diff:      echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst && \
       dpkg-deb -b . /fuse.deb && \
       dpkg -i /fuse.deb && \
  -    rm -rf /tmp/fuse-hack
  +    rm -rf /tmp/fuse-hack && \
   
   # bcbio-nextgen installation
  -RUN mkdir -p /tmp/bcbio-nextgen-install && cd /tmp/bcbio-nextgen-install && \
  +    mkdir -p /tmp/bcbio-nextgen-install && cd /tmp/bcbio-nextgen-install && \
       wget --no-check-certificate \
         https://raw.github.com/chapmanb/bcbio-nextgen/master/scripts/bcbio_nextgen_install.py && \
       python bcbio_nextgen_install.py /usr/local/share/bcbio-nextgen \
  -      --nodata -u development
  -RUN git config --global url.https://github.com/.insteadOf git://github.com/ && \
  -    /usr/local/share/bcbio-nextgen/anaconda/bin/bcbio_nextgen.py upgrade --sudo --tooldir=/usr/local --tools
  -RUN /usr/local/share/bcbio-nextgen/anaconda/bin/bcbio_nextgen.py upgrade --isolate -u development --tools --toolplus data
  -ENV PATH /usr/local/bin:/usr/local/share/bcbio-nextgen/anaconda/bin:${PATH}
  -ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
  -ENV PERL5LIB /usr/local/lib/perl5:${PERL5LIB}
  -RUN echo 'export PATH=/usr/local/bin:$PATH' >> /etc/profile.d/bcbio.sh && \
  -    echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> /etc/profile.d/bcbio.sh && \
  -    echo 'export PERL5LIB=/usr/local/lib/perl5:${PERL5LIB}' >> /etc/profile.d/bcbio.sh && \
  -    echo '/usr/local/lib' >> /etc/ld.so.conf.d/bcbio.conf && ldconfig && \
  +      --nodata -u development && \
  +    git config --global url.https://github.com/.insteadOf git://github.com/ && \
  +    /usr/local/share/bcbio-nextgen/anaconda/bin/bcbio_nextgen.py upgrade --sudo --tooldir=/usr/local --tools && \
  +    /usr/local/share/bcbio-nextgen/anaconda/bin/bcbio_nextgen.py upgrade --isolate -u development --tools --toolplus data  && \
  +
  +# setup paths
  +    echo 'export PATH=/usr/local/bin:$PATH' >> /etc/profile.d/bcbio.sh && \
  +
  +# add user run script
  +    wget --no-check-certificate -O createsetuser \
  +      https://raw.github.com/chapmanb/bcbio-nextgen-vm/master/scripts/createsetuser && \
  +    chmod a+x createsetuser && mv createsetuser /sbin && \
  +
  +# clean filesystem
       apt-get clean && \
       rm -rf /var/lib/apt/lists/* /var/tmp/* && \
       /usr/local/share/bcbio-nextgen/anaconda/bin/conda remove --yes qt && \
  
positive.code: FROM stackbrew/ubuntu:14.04
  MAINTAINER Brad Chapman "https://github.com/chapmanb"
  
  # Setup a base system 
  RUN apt-get update && apt-get install -y build-essential zlib1g-dev wget curl python-setuptools git
  RUN apt-get install -y openjdk-7-jdk openjdk-7-jre ruby libncurses5-dev libcurl4-openssl-dev libbz2-dev \
      unzip pigz bsdmainutils
  
  # Fake a fuse install; openjdk pulls this in 
  # https://github.com/dotcloud/docker/issues/514
  # https://gist.github.com/henrik-muehe/6155333
  RUN mkdir -p /tmp/fuse-hack && cd /tmp/fuse-hack && \
      apt-get install libfuse2 && \
      apt-get download fuse && \
      dpkg-deb -x fuse_* . && \
  
negative.code:     chmod a+rwx /usr/local/share/bcbio-nextgen && \
      chmod a+rwx /usr/local/share/bcbio-nextgen/config && \
      chmod a+rwx /usr/local/share/bcbio-nextgen/config/*.yaml && \
      chmod a+rwx /usr/local/share/bcbio-nextgen/gemini-config.yaml && \
  
  # Ensure permissions are set for update in place by arbitrary users
      find /usr/local -perm /u+x -execdir chmod a+x {} \; && \
      find /usr/local -perm /u+w -execdir chmod a+w {} \;
  