opensafely-core / research-template-docker

This provides the devcontainer Docker image used by repos created from the OpenSAFELY research template.
Other
0 stars 0 forks source link

Populate `org.opencontainers.image.revision` #40

Closed iaindillingham closed 3 months ago

iaindillingham commented 4 months ago

When we build an ehrQL image, we populate org.opencontainers.image.revision with the commit from which the image was built, because the commit makes debugging easier. We should do the same for the research-template image.

Scenario: The build process fails, but we don't notice. We keep merging to main, expecting new images to be built, but they're not built. We'd like to know the commit associated with the last image that was built. At present, we'd have to match timestamps. It would be easier to:

docker inspect ghcr.io/opensafely-core/research-template:v0 | jq '.[0] | .Config.Labels.["org.opencontainers.image.revision"]'

We should also consider populating org.opencontainers.image.created.

iaindillingham commented 4 months ago

As an aside, we should also consider whether we want to overwrite the (other) metadata that comes from rocker/rstudio:

docker inspect ghcr.io/opensafely-core/research-template:v0 | jq '.[0] | .Config.Labels'
{
  "org.opencontainers.image.authors": "Carl Boettiger <cboettig@ropensci.org>",
  "org.opencontainers.image.base.name": "docker.io/rocker/r-ver:4.0.5",
  "org.opencontainers.image.description": "RStudio Server with fixed version of R",
  "org.opencontainers.image.licenses": "GPL-2.0-or-later",
  "org.opencontainers.image.ref.name": "ubuntu",
  "org.opencontainers.image.revision": "3a856a43aa42995176ae201124cc4ba9fe1fce85",
  "org.opencontainers.image.source": "https://github.com/opensafely/research-template",
  "org.opencontainers.image.title": "rocker/rstudio",
  "org.opencontainers.image.vendor": "Rocker Project",
  "org.opencontainers.image.version": "R-4.0.5"
}