From f526e980dd6f1a225ac5ed4fe30174942309540e Mon Sep 17 00:00:00 2001 From: Erik Fasterius Date: Tue, 12 Nov 2024 09:26:45 +0100 Subject: [PATCH 01/22] Remove MAINTAINER label from Dockerfiles --- pages/containers.qmd | 4 ++-- tutorials/containers/Dockerfile | 3 +-- tutorials/containers/Dockerfile_slim | 4 ++-- tutorials/git/Dockerfile | 5 +++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/containers.qmd b/pages/containers.qmd index 24c108b9..5cf50e14 100644 --- a/pages/containers.qmd +++ b/pages/containers.qmd @@ -267,8 +267,8 @@ 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 author="John Sundh, john.sundh@scilifelab.se" +LABEL description="Minimal image for the NBIS reproducible research course." ``` Here we use the instructions `FROM`, `LABEL` and `MAINTAINER`. While `LABEL` diff --git a/tutorials/containers/Dockerfile b/tutorials/containers/Dockerfile index 2fd918bc..e12fad0e 100644 --- a/tutorials/containers/Dockerfile +++ b/tutorials/containers/Dockerfile @@ -1,8 +1,7 @@ FROM --platform=amd64 condaforge/miniforge3 +LABEL authors="John Sundh, john.sundh@scilifelab.se" LABEL description="Image for the NBIS reproducible research course." -LABEL author="John Sundh" -LABEL email="john.sundh@scilifelab.se" # Use bash as shell SHELL ["/bin/bash", "--login", "-c"] diff --git a/tutorials/containers/Dockerfile_slim b/tutorials/containers/Dockerfile_slim index d9ab94e6..8a76363b 100644 --- a/tutorials/containers/Dockerfile_slim +++ b/tutorials/containers/Dockerfile_slim @@ -1,7 +1,7 @@ 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" +LABEL description="Minimal image for the NBIS reproducible research course." # Use bash as shell SHELL ["/bin/bash", "--login", "-c"] diff --git a/tutorials/git/Dockerfile b/tutorials/git/Dockerfile index 67e380ee..852ed7bf 100644 --- a/tutorials/git/Dockerfile +++ b/tutorials/git/Dockerfile @@ -1,10 +1,11 @@ FROM ubuntu:16.04 -LABEL description = "Image for the NBIS reproducible research course." -MAINTAINER "John Sundh" john.sundh@scilifelab.se +LABEL authors="John Sundh, john.sundh@scilifelab.se" +LABEL description="Minimal image for the NBIS reproducible research course." # Use bash as shell SHELL ["/bin/bash", "-c"] + # Set workdir WORKDIR /course From 99795d282590f01cf9d1d0443a7b82a4918e5d86 Mon Sep 17 00:00:00 2001 From: Erik Fasterius Date: Tue, 12 Nov 2024 09:31:40 +0100 Subject: [PATCH 02/22] Add note on OCI Docker label best practices --- pages/containers.qmd | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pages/containers.qmd b/pages/containers.qmd index 5cf50e14..3d21abd5 100644 --- a/pages/containers.qmd +++ b/pages/containers.qmd @@ -271,19 +271,28 @@ LABEL author="John Sundh, john.sundh@scilifelab.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.