Skip to content

Commit 2dd4c8d

Browse files
testing a lighter Dockerfile
1 parent 668decd commit 2dd4c8d

File tree

1 file changed

+54
-32
lines changed

1 file changed

+54
-32
lines changed

Dockerfile

+54-32
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,60 @@
1-
FROM ubuntu:latest
1+
FROM debian:bullseye-slim AS binary
22
LABEL description="cosigt"
3-
LABEL base_image="ubuntu:latest"
3+
LABEL base_image="debian:bullseye-slim"
44
LABEL software="cosigt"
55
LABEL about.home="https://github.com/davidebolo1993/cosigt"
66
LABEL about.license="GPLv3"
77

88
ARG DEBIAN_FRONTEND=noninteractive
99
#install basic libraries and python
10-
#this is useful for having control on all the depenendencies
11-
#odgi and pggb are excluded here
1210

1311
WORKDIR /opt
1412

1513
RUN apt-get update
1614

17-
RUN apt-get -y install build-essential \
15+
RUN apt-get -y install \
16+
build-essential \
1817
software-properties-common \
19-
wget curl git \
20-
bzip2 libbz2-dev \
21-
zlib1g zlib1g-dev \
18+
bash \
19+
wget \
20+
curl \
21+
git \
22+
bzip2 \
23+
libbz2-dev \
24+
zlib1g \
25+
zlib1g-dev \
2226
liblzma-dev \
2327
libssl-dev \
2428
libncurses5-dev \
2529
libz-dev \
26-
python3-dev python3-pip \
30+
python3-dev \
31+
python3-pip \
2732
libjemalloc-dev \
28-
cmake make g++ \
33+
cmake \
34+
make \
35+
g++ \
2936
libhts-dev \
3037
libzstd-dev \
3138
autoconf \
3239
libatomic-ops-dev \
3340
pkg-config \
34-
pigz \
3541
clang-14 \
36-
libomp5 libomp-dev libssl-dev libssl3 pkg-config \
37-
zip unzip
42+
libomp5 \
43+
libomp-dev \
44+
libssl-dev \
45+
libssl3 \
46+
pkg-config \
47+
zip \
48+
unzip
3849

3950
#install golang
4051
RUN add-apt-repository ppa:longsleep/golang-backports
4152

4253
RUN apt-get -y install golang-go \
4354
&& apt-get -y clean all \
44-
&& rm -rf /var/cache
55+
&& apt-get -y purge \
56+
&& rm -rf /var/cache \
57+
&& rm -rf /var/lib/apt/lists/*
4558

4659
#install rust
4760
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
@@ -71,15 +84,19 @@ RUN wget https://github.com/samtools/samtools/releases/download/1.21/samtools-1.
7184
&& cd samtools-1.21 \
7285
&& ./configure \
7386
&& make \
74-
&& make install
87+
&& cp samtools /opt/samtools \
88+
&& cd .. \
89+
&& rm -rf samtools-1.21
7590

7691
##install bwa-mem
7792
RUN git clone https://github.com/lh3/bwa.git \
7893
&& cd bwa \
7994
&& git checkout 79b230de48c74156f9d3c26795a360fc5a2d5d3b \
80-
&& make
81-
82-
ENV PATH /opt/bwa:$PATH
95+
&& make \
96+
&& cp bwa ../bwa-tmp \
97+
&& cd .. \
98+
&& rm -rf bwa \
99+
&& mv bwa-tmp bwa
83100

84101
##install bwa-mem2
85102
RUN wget https://github.com/bwa-mem2/bwa-mem2/releases/download/v2.2.1/bwa-mem2-2.2.1_x64-linux.tar.bz2 \
@@ -108,37 +125,42 @@ RUN wget https://github.com/ChristopherWilks/megadepth/releases/download/1.2.0/m
108125
RUN wget https://github.com/waveygang/wfmash/releases/download/v0.15.0/wfmash \
109126
&& chmod +x wfmash
110127

111-
ENV PATH /opt:$PATH
112-
113128
##install gafpack
114129
RUN git clone https://github.com/ekg/gafpack.git \
115130
&& cd gafpack \
116131
&& git checkout cf2e96057c4efe86317caa990b53f1fc1fdc6367 \
117-
&& cargo install --force --path .
118-
119-
ENV PATH /opt/gafpack/target/release:$PATH
132+
&& cargo install --force --path . \
133+
&& cp target/release/gafpack ../gafpack-tmp \
134+
&& cd .. \
135+
&& rm -rf gafpack \
136+
&& mv gafpack-tmp gafpack
120137

121138
##install gfainject
122139
RUN git clone https://github.com/chfi/gfainject.git \
123140
&& cd gfainject \
124141
&& git checkout e56cba362047e7137352858dfba5f56e944cbf06 \
125-
&& cargo install --force --path .
126-
127-
ENV PATH /opt/gfainject/target/release:$PATH
142+
&& cargo install --force --path . \
143+
&& cp target/release/gfainject ../gfainject-tmp \
144+
&& cd .. \
145+
&& rm -rf gfainject \
146+
&& mv gfainject-tmp gfainject
128147

129148
##install impg
130149
RUN git clone https://github.com/pangenome/impg \
131150
&& cd impg \
132151
&& git checkout 4cf6009160ec9d64e9f9972248511a63d6d012a5 \
133-
&& cargo install --force --path .
134-
135-
ENV PATH /opt/impg/target/release:$PATH
152+
&& cargo install --force --path . \
153+
&& cp target/release/impg ../impg-tmp \
154+
&& cd .. \
155+
&& rm -rf impg \
156+
&& mv impg-tmp impg
136157

137158
##install cosigt
138159
RUN git clone https://github.com/davidebolo1993/cosigt.git \
139160
&& cd cosigt \
140161
&& go mod init cosigt \
141162
&& go mod tidy \
142-
&& go build cosigt
143-
144-
ENV PATH /opt/cosigt:$PATH
163+
&& go build cosigt \
164+
&& cp cosigt ../cosigt-tmp \
165+
&& rm -rf cosigt \
166+
&& mv cosigt-tmp cosigt

0 commit comments

Comments
 (0)