1 Quick reference
- Source repository: rocker-org/devcontainer-images
- Source
- tags
- Published image details: rocker-org/devcontainer-images’s wiki
- Non-root default user:
rstudio
2 Overview
The Rocker Project provides some Docker container images which built with Dev Container Features. Packages commonly used for development are already installed.
These images are intended to be images for R that can be used like the Dev Container images built from devcontainers/images
for each language.
ghcr.io/rocker-org/devcontainer/r-ver
, ghcr.io/rocker-org/devcontainer/tidyverse
, and ghcr.io/rocker-org/devcontainer/geospatial
are correspond to rocker/r-ver
, rocker/tidyverse
, and rocker/geospatial
, respectively.
3 How to use
3.1 devcontainer.json and Dockerfile
Specify the image in devcontainer.json
as follows.
.devcontainer/devcontainer.json
{
"image": "ghcr.io/rocker-org/devcontainer/r-ver:4"
}
The basic usage is to customize by adding Dev Container Features here.
Or, we can use it as a base image in a Dockerfile.
.devcontainer/Dockerfile
FROM ghcr.io/rocker-org/devcontainer/tidyverse:4
To install the R package on the Dockerfile, please refer to the Extending images page.
When using a combination of a devcontainer.json
and a Dockerfile, the devcontainer.json
file must be rewritten to refer to the Dockerfile.
.devcontainer/devcontainer.json
{
"build": {
"dockerfile": "Dockerfile"
}
}
3.2 Command line
We can use radian instead of the default R console.
Terminal
docker run --rm -ti ghcr.io/rocker-org/devcontainer/r-ver:4 radian
Also httpgd
is already installed so we can expose the container port to show the plot in the browser. See the GUI page for details.
3.3 RStudio Server
ghcr.io/rocker-org/devcontainer/tidyverse
and ghcr.io/rocker-org/devcontainer/geospatial
have already installed RStudio Server. See the rocker/rstudio
reference page for usage.