From 9c42ee7a6441885f1dddfeac9da73889934aafc7 Mon Sep 17 00:00:00 2001 From: fwip Date: Wed, 14 Mar 2018 15:12:58 -0700 Subject: [PATCH 1/6] Add preliminary dockerfile Uses a multi-stage build to get all the dependencies in order. --- .dockerignore | 31 ++++++++++++++++++++++++++ Dockerfile | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..25bf2bd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,31 @@ +bin + +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..34546a5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,60 @@ +# Build modwt +FROM alpine as modwt-build +RUN apk update +RUN apk add \ + g++ \ + git \ + make +RUN git clone https://github.com/StamLab/modwt.git \ + && cd modwt \ + && git checkout 28e9f479c737836ffc870199f2468e30659ab38d \ + && make + +# Build samtools +FROM alpine as samtools-build +RUN apk update \ + && apk add \ + autoconf \ + g++ \ + git \ + bzip2-dev \ + make \ + ncurses-dev \ + xz-dev \ + zlib-dev +RUN wget https://github.com/samtools/samtools/releases/download/1.7/samtools-1.7.tar.bz2 \ + && tar xf samtools-1.7.tar.bz2 \ + && cd samtools-1.7 \ + && make install + +# Build hotspot2 +FROM alpine as hotspot2-build +RUN apk update +RUN apk add \ + bash \ + g++ \ + make +WORKDIR /hotspot2 +ADD . . +RUN make + +# Build the final container +FROM alpine as hotspot2 +# Install dynamic libraries +RUN apk update \ + && apk add \ + bash \ + bzip2-dev \ + ncurses \ + xz-dev \ + zlib-dev +# Get bedops +RUN wget -O - https://github.com/bedops/bedops/releases/download/v2.4.31/bedops_linux_x86_64-v2.4.31.tar.bz2 \ + | tar -C /usr/local -xjf - +# Get bedgraph2BigWig +RUN cd /usr/local/bin && wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig +# Get built files +COPY --from=modwt-build /modwt/bin/ /usr/local/bin +COPY --from=samtools-build /usr/local/bin /usr/local/bin +COPY --from=hotspot2-build /hotspot2/bin/ /usr/local/bin/ +COPY --from=hotspot2-build /hotspot2/scripts/ /usr/local/bin/ From 3e776094586c2e58cb770c9e03dbfdd7c55fbd87 Mon Sep 17 00:00:00 2001 From: fwip Date: Wed, 14 Mar 2018 17:20:43 -0700 Subject: [PATCH 2/6] Build bedGraphToBigWig --- Dockerfile | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34546a5..9ba1dd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,6 +38,25 @@ WORKDIR /hotspot2 ADD . . RUN make +# Build bedGraphToBigWig +FROM alpine as kentutils-build +RUN apk update \ + && apk add \ + g++ \ + gcc \ + git \ + libpng-dev \ + make \ + mysql-dev \ + zlib-dev + +# Get an archive of kentUtils, remove a file that doesn't build, and compile +RUN wget https://github.com/ENCODE-DCC/kentUtils/archive/v302.0.0.tar.gz \ + && tar xf v302.0.0.tar.gz \ + && cd kentUtils-302.0.0 \ + && sed -i 's/fof.o //' src/lib/makefile \ + && make + # Build the final container FROM alpine as hotspot2 # Install dynamic libraries @@ -51,10 +70,9 @@ RUN apk update \ # Get bedops RUN wget -O - https://github.com/bedops/bedops/releases/download/v2.4.31/bedops_linux_x86_64-v2.4.31.tar.bz2 \ | tar -C /usr/local -xjf - -# Get bedgraph2BigWig -RUN cd /usr/local/bin && wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/bedGraphToBigWig # Get built files -COPY --from=modwt-build /modwt/bin/ /usr/local/bin -COPY --from=samtools-build /usr/local/bin /usr/local/bin +COPY --from=kentutils-build /kentUtils-302.0.0/bin/bedGraphToBigWig /usr/local/bin/ +COPY --from=modwt-build /modwt/bin/ /usr/local/bin/ +COPY --from=samtools-build /usr/local/bin /usr/local/bin/ COPY --from=hotspot2-build /hotspot2/bin/ /usr/local/bin/ COPY --from=hotspot2-build /hotspot2/scripts/ /usr/local/bin/ From 97bc96060a77d3979bf2a16a96b0f11b3b6ce269 Mon Sep 17 00:00:00 2001 From: fwip Date: Wed, 14 Mar 2018 17:56:45 -0700 Subject: [PATCH 3/6] Specify alpine:3.7 --- Dockerfile | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9ba1dd6..d79ddda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Build modwt -FROM alpine as modwt-build -RUN apk update -RUN apk add \ +FROM alpine:3.7 as modwt-build +RUN apk add --no-cache \ g++ \ git \ make @@ -11,9 +10,8 @@ RUN git clone https://github.com/StamLab/modwt.git \ && make # Build samtools -FROM alpine as samtools-build -RUN apk update \ - && apk add \ +FROM alpine:3.7 as samtools-build +RUN apk add --no-cache \ autoconf \ g++ \ git \ @@ -28,9 +26,8 @@ RUN wget https://github.com/samtools/samtools/releases/download/1.7/samtools-1.7 && make install # Build hotspot2 -FROM alpine as hotspot2-build -RUN apk update -RUN apk add \ +FROM alpine:3.7 as hotspot2-build +RUN apk add --no-cache \ bash \ g++ \ make @@ -39,9 +36,8 @@ ADD . . RUN make # Build bedGraphToBigWig -FROM alpine as kentutils-build -RUN apk update \ - && apk add \ +FROM alpine:3.7 as kentutils-build +RUN apk add --no-cache \ g++ \ gcc \ git \ @@ -49,7 +45,6 @@ RUN apk update \ make \ mysql-dev \ zlib-dev - # Get an archive of kentUtils, remove a file that doesn't build, and compile RUN wget https://github.com/ENCODE-DCC/kentUtils/archive/v302.0.0.tar.gz \ && tar xf v302.0.0.tar.gz \ @@ -58,10 +53,9 @@ RUN wget https://github.com/ENCODE-DCC/kentUtils/archive/v302.0.0.tar.gz \ && make # Build the final container -FROM alpine as hotspot2 +FROM alpine:3.7 as hotspot2 # Install dynamic libraries -RUN apk update \ - && apk add \ +RUN apk add --no-cache \ bash \ bzip2-dev \ ncurses \ From 1310fc9b31e63a1362fa1e0e25455899b7cdd3a2 Mon Sep 17 00:00:00 2001 From: fwip Date: Wed, 14 Mar 2018 21:32:51 -0700 Subject: [PATCH 4/6] Add bc to dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d79ddda..3926eb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,7 @@ FROM alpine:3.7 as hotspot2 # Install dynamic libraries RUN apk add --no-cache \ bash \ + bc \ bzip2-dev \ ncurses \ xz-dev \ From d9271ff3c39d9450374fb445a8fa34653053ad8b Mon Sep 17 00:00:00 2001 From: fwip Date: Wed, 14 Mar 2018 21:36:42 -0700 Subject: [PATCH 5/6] Add coreutils (for mktemp -t flag) --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 3926eb7..a8830fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,7 @@ RUN apk add --no-cache \ bash \ bc \ bzip2-dev \ + coreutils \ ncurses \ xz-dev \ zlib-dev From 1f6871dbc0264a2101fdd5db602aab087d9baeea Mon Sep 17 00:00:00 2001 From: fwip Date: Fri, 16 Mar 2018 15:56:44 -0700 Subject: [PATCH 6/6] Add bedToBigBed binary --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index a8830fb..a8cd6ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,7 +68,11 @@ RUN wget -O - https://github.com/bedops/bedops/releases/download/v2.4.31/bedops_ | tar -C /usr/local -xjf - # Get built files COPY --from=kentutils-build /kentUtils-302.0.0/bin/bedGraphToBigWig /usr/local/bin/ +COPY --from=kentutils-build /kentUtils-302.0.0/bin/bedToBigBed /usr/local/bin/ + COPY --from=modwt-build /modwt/bin/ /usr/local/bin/ + COPY --from=samtools-build /usr/local/bin /usr/local/bin/ + COPY --from=hotspot2-build /hotspot2/bin/ /usr/local/bin/ COPY --from=hotspot2-build /hotspot2/scripts/ /usr/local/bin/