Skip to content

Latest commit

 

History

History
91 lines (65 loc) · 1.97 KB

File metadata and controls

91 lines (65 loc) · 1.97 KB

docker-rpython

Repo for creating a docker images containing both python and R, for use in CI and as dev containers.

The images contains tools like poetry and nox, so no need to install them in the CI pipeline.

Installed R-packages

The following R-packages with their dependencies are installed in the base container image:

From CRAN:

  • dplyr
  • gausssuppression
  • httpgd
  • languageserver
  • modsem
  • shiny
  • ssbtools

From GitHub:

  • ssb-metodebiblioteket
  • ssb-ssb-fellesr

Versions

  • python 3.12
  • R 4.4
  • poetry 2.2.1
  • nox 2025.11.12

Releases

The docker images are published as GitHub Packages on this page.

Usage

docker pull ghcr.io/statisticsnorway/docker-rpython-base:latest  # Image for use in GitHub Actions
docker pull ghcr.io/statisticsnorway/docker-rpython-dev:latest   # Latest dev-image

Build docker images

Automatically

Both docker images are built and published when a tag starting with v is pushed to the repo. Example:

git tag  # List existing tags, pick the next one
git tag -a v1.0.3 -m"Tagging docker image"  # create new tag
git push --tags

Manually

You need to set the environment variable GITHUB_PAT before running the commands.

export GITHUB_PAT="ghp_yourPersonalAccessTokenHere"

GitHub Action image (base)

From the root of the repo:

cd base
docker build --secret id=github_pat,env=GITHUB_PAT -t ghcr.io/statisticsnorway/docker-rpython-base:1.0 .
docker push ghcr.io/statisticsnorway/docker-rpython-base:1.0

Dev image

From the root of the repo:

cd dev
docker build -t ghcr.io/statisticsnorway/docker-rpython-dev:1.0 .
docker push ghcr.io/statisticsnorway/docker-rpython-dev:1.0

Authenticate with GitHub Container Registry

Your PAT must have the read:packages scope.

export CR_PAT=<YourPAT>
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin