-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release with Docker files to build a container
- Loading branch information
Showing
8 changed files
with
275 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
FROM ubuntu:16.04 as builder | ||
|
||
USER root | ||
|
||
# ALL tool versions used by opt-build.sh | ||
ENV VER_HTSLIB="1.7" | ||
|
||
RUN apt-get -yq update | ||
RUN apt-get install -yq --no-install-recommends \ | ||
build-essential \ | ||
apt-transport-https \ | ||
curl \ | ||
ca-certificates \ | ||
make \ | ||
bzip2 \ | ||
gcc \ | ||
locales \ | ||
curl \ | ||
wget \ | ||
libtasn1-dev \ | ||
libgnutls-dev \ | ||
nettle-dev \ | ||
libgmp-dev \ | ||
libp11-kit-dev \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
liblzma-dev \ | ||
libcurl4-gnutls-dev \ | ||
libncurses5-dev | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
RUN update-locale LANG=en_US.UTF-8 | ||
|
||
ENV OPT /opt/wtsi-cgp | ||
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$PATH | ||
ENV PERL5LIB $OPT/lib/perl5 | ||
ENV LD_LIBRARY_PATH $OPT/lib | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
|
||
# build tools from other repos | ||
ADD build/opt-build.sh build/ | ||
RUN bash build/opt-build.sh $OPT | ||
|
||
# build the tools in this repo, separate to reduce build time on errors | ||
COPY . . | ||
RUN bash build/opt-build-local.sh $OPT | ||
|
||
FROM ubuntu:16.04 | ||
|
||
LABEL maintainer="cgphelp@sanger.ac.uk" \ | ||
uk.ac.sanger.cgp="Cancer, Ageing and Somatic Mutation, Wellcome Trust Sanger Institute" \ | ||
version="v1.0.0" \ | ||
description="alleleCount docker" | ||
|
||
RUN apt-get -yq update | ||
RUN apt-get install -yq --no-install-recommends \ | ||
apt-transport-https \ | ||
locales \ | ||
curl \ | ||
ca-certificates \ | ||
libperlio-gzip-perl \ | ||
bzip2 \ | ||
psmisc \ | ||
time \ | ||
zlib1g \ | ||
liblzma5 \ | ||
libncurses5 \ | ||
p11-kit \ | ||
unattended-upgrades && \ | ||
unattended-upgrade -d -v && \ | ||
apt-get remove -yq unattended-upgrades && \ | ||
apt-get autoremove -yq | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
RUN update-locale LANG=en_US.UTF-8 | ||
|
||
ENV OPT /opt/wtsi-cgp | ||
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$PATH | ||
ENV PERL5LIB $OPT/lib/perl5 | ||
ENV LD_LIBRARY_PATH $OPT/lib | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
|
||
RUN mkdir -p $OPT | ||
COPY --from=builder $OPT $OPT | ||
|
||
## USER CONFIGURATION | ||
RUN adduser --disabled-password --gecos '' ubuntu && chsh -s /bin/bash && mkdir -p /home/ubuntu | ||
|
||
USER ubuntu | ||
WORKDIR /home/ubuntu | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#! /bin/bash | ||
|
||
set -xe | ||
|
||
if [[ -z "${TMPDIR}" ]]; then | ||
TMPDIR=/tmp | ||
fi | ||
|
||
set -u | ||
|
||
if [ "$#" -lt "1" ] ; then | ||
echo "Please provide an installation path such as /opt/ICGC" | ||
exit 1 | ||
fi | ||
|
||
# get path to this script | ||
SCRIPT_PATH=`dirname $0`; | ||
SCRIPT_PATH=`(cd $SCRIPT_PATH && pwd)` | ||
|
||
# get the location to install to | ||
INST_PATH=$1 | ||
mkdir -p $1 | ||
INST_PATH=`(cd $1 && pwd)` | ||
echo $INST_PATH | ||
|
||
# get current directory | ||
INIT_DIR=`pwd` | ||
|
||
CPU=`grep -c ^processor /proc/cpuinfo` | ||
if [ $? -eq 0 ]; then | ||
if [ "$CPU" -gt "6" ]; then | ||
CPU=6 | ||
fi | ||
else | ||
CPU=1 | ||
fi | ||
echo "Max compilation CPUs set to $CPU" | ||
|
||
SETUP_DIR=$INIT_DIR/install_tmp | ||
mkdir -p $SETUP_DIR/distro # don't delete the actual distro directory until the very end | ||
mkdir -p $INST_PATH/bin | ||
cd $SETUP_DIR | ||
|
||
# make sure tools installed can see the install loc of libraries | ||
set +u | ||
export LD_LIBRARY_PATH=`echo $INST_PATH/lib:$LD_LIBRARY_PATH | perl -pe 's/:\$//;'` | ||
export PATH=`echo $INST_PATH/bin:$PATH | perl -pe 's/:\$//;'` | ||
export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/:\$//;'` | ||
export PERL5LIB=`echo $INST_PATH/lib/perl5:$PERL5LIB | perl -pe 's/:\$//;'` | ||
CPANM=`which cpanm` | ||
echo "Installing Perl prerequisites ..." | ||
$CPANM --no-interactive --notest --mirror http://cpan.metacpan.org -l $INST_PATH/ --installdeps $INIT_DIR/perl/. < /dev/null | ||
|
||
set -u | ||
### alleleCount | ||
echo "Building alleleCounter ..." | ||
if [ ! -e $SETUP_DIR/alleleCount.success ]; then | ||
#build the C part | ||
cd $INIT_DIR | ||
mkdir -p $INIT_DIR/c/bin | ||
make -C c clean | ||
export prefix=$INST_PATH | ||
make -C c -j$CPU | ||
cp $INIT_DIR/c/bin/alleleCounter $INST_PATH/bin/. | ||
#build the perl part | ||
cd $INIT_DIR/perl | ||
perl Makefile.PL INSTALL_BASE=$INST_PATH | ||
make | ||
make test | ||
make install | ||
touch $SETUP_DIR/alleleCounter.success | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#! /bin/bash | ||
|
||
set -xe | ||
|
||
if [[ -z "${TMPDIR}" ]]; then | ||
TMPDIR=/tmp | ||
fi | ||
|
||
set -u | ||
|
||
if [ "$#" -lt "1" ] ; then | ||
echo "Please provide an installation path such as /opt/ICGC" | ||
exit 1 | ||
fi | ||
|
||
# get path to this script | ||
SCRIPT_PATH=`dirname $0`; | ||
SCRIPT_PATH=`(cd $SCRIPT_PATH && pwd)` | ||
|
||
# get the location to install to | ||
INST_PATH=$1 | ||
mkdir -p $1 | ||
INST_PATH=`(cd $1 && pwd)` | ||
echo $INST_PATH | ||
|
||
# get current directory | ||
INIT_DIR=`pwd` | ||
|
||
CPU=`grep -c ^processor /proc/cpuinfo` | ||
if [ $? -eq 0 ]; then | ||
if [ "$CPU" -gt "6" ]; then | ||
CPU=6 | ||
fi | ||
else | ||
CPU=1 | ||
fi | ||
echo "Max compilation CPUs set to $CPU" | ||
|
||
SETUP_DIR=$INIT_DIR/install_tmp | ||
mkdir -p $SETUP_DIR/distro # don't delete the actual distro directory until the very end | ||
mkdir -p $INST_PATH/bin | ||
cd $SETUP_DIR | ||
|
||
# make sure tools installed can see the install loc of libraries | ||
set +u | ||
export LD_LIBRARY_PATH=`echo $INST_PATH/lib:$LD_LIBRARY_PATH | perl -pe 's/:\$//;'` | ||
export PATH=`echo $INST_PATH/bin:$PATH | perl -pe 's/:\$//;'` | ||
export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/:\$//;'` | ||
export PERL5LIB=`echo $INST_PATH/lib/perl5:$PERL5LIB | perl -pe 's/:\$//;'` | ||
set -u | ||
|
||
## grab cpanm | ||
curl -L http://cpanmin.us | perl - App::cpanminus | ||
CPANM=`which cpanm` | ||
|
||
echo "Installing Perl base deps ..." | ||
if [ ! -e $SETUP_DIR/basePerlDeps.success ]; then | ||
perlmods=( "ExtUtils::CBuilder" "Module::Build~0.42" "Const::Fast" "File::Which" "LWP::UserAgent") | ||
for i in "${perlmods[@]}" ; do | ||
$CPANM --no-interactive --notest --mirror http://cpan.metacpan.org -l $INST_PATH $i | ||
done | ||
touch $SETUP_DIR/basePerlDeps.success | ||
fi | ||
|
||
SOURCE_HTSLIB="https://github.com/samtools/htslib/releases/download/${VER_HTSLIB}/htslib-${VER_HTSLIB}.tar.bz2" | ||
|
||
cd $SETUP_DIR | ||
|
||
echo "Downloading htslib ..." | ||
if [ ! -e $SETUP_DIR/htslibGet.success ]; then | ||
cd $SETUP_DIR | ||
wget $SOURCE_HTSLIB | ||
touch $SETUP_DIR/htslibGet.success | ||
fi | ||
|
||
echo "Building htslib ..." | ||
if [ ! -e $SETUP_DIR/htslib.success ]; then | ||
mkdir -p htslib | ||
tar --strip-components 1 -C htslib -jxf htslib-${VER_HTSLIB}.tar.bz2 | ||
cd htslib | ||
./configure --enable-plugins --enable-libcurl --prefix=$INST_PATH | ||
make -j$CPU | ||
make install | ||
cd $SETUP_DIR | ||
touch $SETUP_DIR/htslib.success | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters