Skip to content

Commit

Permalink
Merge pull request #2 from statisticsnorway/dockerfiles
Browse files Browse the repository at this point in the history
Add dockerfiles for base and dev
  • Loading branch information
arneso-ssb authored Oct 14, 2024
2 parents 222abf0 + 382e72e commit 8fd8e56
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 80 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
* text=auto eol=lf
*.ipynb filter=nbstripout
*.ipynb diff=ipynb
73 changes: 0 additions & 73 deletions .pre-commit-config.yaml

This file was deleted.

49 changes: 44 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
# docker-rpython
Repo for creating a docker images containing both python and R, for use in CI and as
dev containers.

Repo for creating a docker images containing both python and R, for use in vscode asCI and dev containers.
## Installed R-packages
The following R-packages with their dependencies are installed in the conatainer image:

Opprettet av:
arneso-ssb <[email protected]>
From CRAN:
* dplyr
* gausssuppression
* httpgd
* languageserver
* modsem
* shiny
* ssbtools

---
From GitHub:
* ssb-metodebiblioteket
* ssb-ssb-fellesr

Legg inn beskrivelse av prosjektet her.
## Usage
```shell
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
```

docker pull

## Build docker images

### GitHub Action image (base)

From the root of the repo:

```shell
cd docker-base
docker build -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:

```shell
cd docker-dev
docker build -t ghcr.io/statisticsnorway/docker-rpython-dev:1.0 .
docker push ghcr.io/statisticsnorway/docker-rpython-dev:1.0
```
33 changes: 33 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM rocker/r2u:24.04

LABEL org.opencontainers.image.source=https://github.com/statisticsnorway/docker-rpython
LABEL org.opencontainers.image.description="Container for running both python and R, based on r2u."
LABEL org.opencontainers.image.licenses=MIT

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
micro \
nano \
pipx \
python3-pip \
python3-poetry \
python3-venv \
r-cran-dplyr \
r-cran-gausssuppression \
r-cran-httpgd \
r-cran-languageserver \
r-cran-modsem \
r-cran-shiny \
r-cran-ssbtools \
sudo \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*

RUN R -e "remotes::install_github(c(\
'statisticsnorway/ssb-metodebiblioteket', \
'statisticsnorway/ssb-fellesr' \
))"

RUN pipx ensurepath && pipx install nox && pipx inject nox nox-poetry

25 changes: 25 additions & 0 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ghcr.io/statisticsnorway/docker-rpython-base:1.0

LABEL org.opencontainers.image.source=https://github.com/statisticsnorway/docker-rpython
LABEL org.opencontainers.image.description="Container for running both python and R."
LABEL org.opencontainers.image.licenses=MIT

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libcairo2-dev \
libcurl4-openssl-dev \
libfontconfig1-dev \
libfreetype6-dev \
libfribidi-dev \
libharfbuzz-dev \
libjpeg-dev \
libpango1.0-dev \
libpng-dev \
libssl-dev \
libtiff-dev \
libxml2-dev \
python-is-python3 \
python3 \
python3-dev \
&& apt-get purge -y --auto-remove \
&& rm -rf /var/lib/apt/lists/*

0 comments on commit 8fd8e56

Please sign in to comment.