Commit 9cf6b828 authored by Daniel Nüst's avatar Daniel Nüst Committed by James Lamb
Browse files

add Dockerfile for R (#2308)

* add Dockerfile for R

* update documentation and small fixes

part of code review in #2308

* add missing link in Docker README
parent 5cff4e8e
...@@ -70,3 +70,44 @@ After build finished, run the container: ...@@ -70,3 +70,44 @@ After build finished, run the container:
``` ```
docker run --rm -it lightgbm docker run --rm -it lightgbm
``` ```
## Running the R-package Сontainer
Build the container based on the [`verse` Rocker image](https://www.rocker-project.org/images/), for R users:
```
mkdir lightgbm-docker
cd lightgbm-docker
wget https://raw.githubusercontent.com/Microsoft/LightGBM/master/docker/dockerfile-r
docker build -t lightgbm-r -f dockerfile-r .
```
After the build is finished you have two options to run the container:
1. Start [RStudio](https://www.rstudio.com/products/rstudio/), an interactive development environment, so that you can develop your analysis using LightGBM or simply try out the R package. You can open RStudio in your web browser.
2. Start a regular R session.
In both cases you can simply call
```
library("lightgbm")
```
to load the installed LightGBM R package.
**RStudio**
```
docker run --rm -it -e PASSWORD=lightgbm -p 8787:8787 lightgbm-r
```
Open the browser at http://localhost:8787 and log in.
See the [`rocker/rstudio`](https://hub.docker.com/r/rocker/rstudio) image documentation for further configuration options.
**Regular R**
If you just want a vanilla R process, change the executable of the container:
```
docker run --rm -it lightgbm-r R
```
FROM rocker/verse:latest
WORKDIR /lgbm
# R
RUN apt-get update && \
apt-get install -y build-essential && \
git clone --recursive --branch stable https://github.com/Microsoft/LightGBM && \
cd LightGBM && \
Rscript build_r.R
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment