* add Dockerfile for R

* update documentation and small fixes

part of code review in #2308

* add missing link in Docker README
This commit is contained in:
Daniel Nüst 2019-08-12 16:50:03 +02:00 коммит произвёл James Lamb
Родитель 5cff4e8e2f
Коммит 9cf6b8283d
2 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -70,3 +70,44 @@ After build finished, run the container:
```
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
```

10
docker/dockerfile-r Normal file
Просмотреть файл

@ -0,0 +1,10 @@
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