diff --git a/pages/containers.qmd b/pages/containers.qmd index 24c108b9..4a18032f 100644 --- a/pages/containers.qmd +++ b/pages/containers.qmd @@ -194,7 +194,7 @@ curl -o NCTC8325.fa.gz ftp://ftp.ensemblgenomes.org/pub/bacteria/release-37/fast gunzip -c NCTC8325.fa.gz > tempfile ``` -To download and prepare the input for Bowtie2. +to download and prepare the input for Bowtie2. Now try running the following Bash code: @@ -249,16 +249,23 @@ blueprints for the images. It is therefore good practice to have your Dockerfile in your project Git repository, since it allows other users to exactly replicate your project environment. -We will be looking at a Dockerfile called `Dockerfile_slim` that is located in +We will be looking at a Dockerfile called `slim.Dockerfile` that is located in your `containers` directory (where you should hopefully be standing already). We will now go through that file and discuss the different steps and what they do. After that we'll build the image and test it out. Lastly, we'll start from that image and make a new one to reproduce the results from the [Conda tutorial](conda.html#working-with-environments). +::: {.callout-note title="Naming Dockerfile"} +The default name for a Dockerfile is just that, `Dockerfile`. In cases where you +want to have more than one Dockerfile in a single directory you can use the +format `.Dockerfile` instead, as per the [official +documentation](https://docs.docker.com/build/concepts/dockerfile/#filename). +::: + ### Understanding Dockerfiles -Here are the first few lines of `Dockerfile_slim`. Each line in the Dockerfile +Here are the first few lines of `slim.Dockerfile`. Each line in the Dockerfile will typically result in one layer in the resulting image. The format for Dockerfiles is `INSTRUCTION arguments`. A full specification of the format, together with best practices, can be found at the [Docker @@ -267,23 +274,32 @@ website](https://docs.docker.com/engine/reference/builder/). ```Dockerfile FROM condaforge/miniforge3 -LABEL description = "Minimal image for the NBIS reproducible research course." -MAINTAINER "John Sundh" john.sundh@scilifelab.se +LABEL authors="John Sundh, john.sundh@scilifelab.se; Erik Fasterius, erik.fasterius@nbis.se" +LABEL description="Minimal image for the NBIS reproducible research course." ``` -Here we use the instructions `FROM`, `LABEL` and `MAINTAINER`. While `LABEL` -and `MAINTAINER` is just meta-data that can be used for organising your -various Docker components the important one is `FROM`, which specifies the -base image we want to start from. Because we want to use `conda` to install -packages we will start from an image from the conda-forge community that has -`conda` pre-installed. This image was in turn built using a Dockerfile as a -blueprint and then uploaded to +Here we use the instructions `FROM` and `LABEL`. While `LABEL` is just key/value +metadata pairs that can be used for organising your various Docker components, +the important one is `FROM`, which specifies the base image we want to start +from. Because we want to use `conda` to install packages we will start from an +image from the conda-forge community that has `conda` pre-installed. This image +was in turn built using a Dockerfile as a blueprint and then uploaded to [Dockerhub](https://hub.docker.com/r/condaforge/miniforge3). The conda-forge community keeps the Dockerfile in a git repository and you can view the file [here](https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile). -You will see that it starts from an official Ubuntu image (check the first -line with the `FROM` instruction), followed by code to install various -packages including conda. +You will see that it starts from an official Ubuntu image (check the first line +with the `FROM` instruction), followed by code to install various packages +including conda. + +::: {.callout-note title="A note on label best practices"} +While you can use arbitrary key/value pairs for LABEL instructions however you +like, there _are_ best practices available that you might want to follow. These +follow the format of `org.opencontainers.image.