1 # Build the base image. This is the starting point for both the build
2 # stage and the final stage.
3 # the "AS base" names the image within the Dockerfile
4 FROM debian:10-slim AS base
5 MAINTAINER Peter Amstutz <peter.amstutz@curii.com>
7 # Install libz, because the bwa binary will depend on it.
8 # As it happens, this already included in the base Debian distribution
9 # because lots of things use libz specifically, but it is good practice
10 # to explicitly declare that we need it.
11 RUN apt-get update -qy
12 RUN apt-get install -qy zlib1g
15 # This is the builder image. It has the commands to install the
16 # prerequisites and then build the bwa binary.
18 RUN apt-get install -qy build-essential wget unzip zlib1g-dev
21 RUN wget https://github.com/lh3/bwa/archive/v0.7.17.zip
23 RUN cd bwa-0.7.17 && \
28 # Build the final image. It starts from base (where we ensured that
29 # libz was installed) and then copies the bwa binary from the builder
30 # image. The result is the final image only has the compiled bwa
31 # binary, but not the clutter from build-essentials or from compiling
35 # This is the key command, we use the COPY command described earlier,
36 # but instead of copying from the host, the --from option copies from
38 COPY --from=builder /usr/bin/bwa /usr/bin/bwa