Fix link, add explicit solution to exercise
[rnaseq-cwl-training.git] / _episodes / 08-supplement-docker.md
index d297a95dc3e8fd4ac3b6add9caa269616a1a8361..a82285ede2f826cf13eb7fdaa2f8dabd35405432 100644 (file)
@@ -158,6 +158,24 @@ docker build -t training/bwa -f Dockerfile.single-stage .
 >
 > Create a `Dockerfile` based on this lesson and build it for yourself.
 >
+> > ## Solution
+> >
+> > FROM debian:10-slim
+> > MAINTAINER Peter Amstutz <peter.amstutz@curii.com>
+> >
+> > RUN apt-get update -qy
+> > RUN apt-get install -qy build-essential wget unzip zlib1g-dev
+> >
+> > # Install BWA 07.7.17
+> > RUN wget https://github.com/lh3/bwa/archive/v0.7.17.zip && \
+> >    unzip v0.7.17 && \
+> >    cd bwa-0.7.17 && \
+> >    make && \
+> >    cp bwa /usr/bin && \
+> >    cd .. && \
+> >    rm -rf bwa-0.7.17
+> >
+> {: .solution}
 {: .challenge}
 
 # Adding files to the image during the build
@@ -236,9 +254,7 @@ COPY --from=builder /usr/bin/bwa /usr/bin/bwa
 
 # Best practices for Docker images
 
-Docker has published guidelines on building efficient images:
-
-https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
+[Docker has published guidelines on building efficient images.](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
 
 Some additional considerations when building images for use with Workflows:
 
@@ -257,7 +273,7 @@ reproducibility of your Docker image builds.
 
 Similarly, be as specific as possible about the version of the base
 image you want to use in your `FROM` command.  If you don't specify a
-tag, the default tag is called "latest".
+tag, the default tag is called "latest", which can change at any time.
 
 ## Tag your builds
 
@@ -302,3 +318,8 @@ the file being downloaded changes without the command being used to
 download it changing, it will reuse the cached step with the old copy
 of the file, instead of re-downloading it.  If this happens, use
 `--no-cache` to force it to re-run the steps.
+
+> ## Episode solution
+> * <a href="../assets/answers/ep8/Dockerfile.single-stage">Dockerfile.single-stage</a>
+> * <a href="../assets/answers/ep8/Dockerfile.multi-stage">Dockerfile.multi-stage</a>
+{: .solution}