Skip to content

MRCIEU/docker_twosamplemr

Repository files navigation

Dockerfile for TwoSampleMR

Usage

This is the Dockerfile for the TwoSampleMR dockerhub image, which can be run with

docker run -it mrcieu/twosamplemr R

or run a specific tag with, e.g., 0.6.15

docker run -it mrcieu/twosamplemr:0.6.15 R

Developers

If you are updating this and don't have access to the mrcieu dockerhub organization please send your dockerhub username to @t0mrg.

Things to check to update on every build

  • Check if the version of R needs updating: look in the code - if it needs updating, update the version in the Dockerfile, justfile, and README.md.
  • Check if the version of Bioconductor needs to be updated in build.R.
  • Update the PPPM snapshot dates in build.R.

Build the image

First go through the Dockerfile and build.R to check whether the versions of R, Bioconductor, and the Posit Public Package Manager CRAN and Bioconductor snapshot date URLs are up to date (cran_bioc_date) - you can check those dates at

Then check the current base of rocker/r-ver:4.5.1 with

docker pull --platform linux/amd64 rocker/r-ver:4.5.1
docker run --platform linux/amd64 rocker/r-ver:4.5.1 cat /etc/lsb-release

And if building the multiple architecture image check

just check

Currently it uses Ubuntu Noble Numbat 24.04.2 LTS. This tells you if you can use the Linux binaries from r-universe which are currently built on Ubuntu Noble Numbat - it's safest to only use the binaries if these Ubuntu versions match. There is likely to be at least a 90 day period after the release of of an Ubuntu LTS during which these versions do not match, i.e., r-universe moves to the new LTS straight away but rocker takes longer to use the new LTS.

If the bases do not match then you must only use source package URLs within build.R (you will need to edit the file).

Building a solely amd64 architecture image

docker pull --platform linux/amd64 rocker/r-ver:4.5.1
docker build --pull --no-cache --platform linux/amd64 -t mrcieu/twosamplemr .

Building a multi-architecture image

For the multi-architecture image you must enable the containerd image store in Docker Desktop settings.

Build the image (untagged/latest) and then add a version number tag as follows.

just build

Run the test script

Then run the test script, which checks TwoSampleMR and its Imports and Suggests (i.e., hard and soft) dependency packages will load.

For the single architecture image run the following.

docker run --platform linux/amd64 -v /$PWD:/usr/local/src/myscripts mrcieu/twosamplemr:latest /bin/bash -c "R CMD BATCH test.R test-amd64.Rout"

In the test.Rout file check that the version of TwoSampleMR is the latest one you expect.

Running the test script for the multiarch image

just test

In the test-amd64.Rout and test-arm64.Rout files check that the version of TwoSampleMR is the latest one you expect.

Push to DockerHub

Then login to DockerHub, and push both the version numbered tag and the latest tag (this is necessary so that the mrcieu/twosamplemr image is the latest, but we also show version numbers in the tags).

Pushing the single architecture image

docker login
docker tag mrcieu/twosamplemr mrcieu/twosamplemr:<version_no>
docker push mrcieu/twosamplemr:<version_no>
docker tag mrcieu/twosamplemr:<version_no> mrcieu/twosamplemr:latest
docker push mrcieu/twosamplemr:latest

Pushing the multiarchitecture image

just publish VERSION

About

Dockerfile for TwoSampleMR DockerHub image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •