Unverified Commit 4adb9ff7 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] [docker] Added ability to build LightGBM in an R container with...

[R-package] [docker] Added ability to build LightGBM in an R container with different R versions (#2787)
parent 4b55ed3a
...@@ -81,6 +81,18 @@ wget https://raw.githubusercontent.com/Microsoft/LightGBM/master/docker/dockerfi ...@@ -81,6 +81,18 @@ wget https://raw.githubusercontent.com/Microsoft/LightGBM/master/docker/dockerfi
docker build -t lightgbm-r -f dockerfile-r . docker build -t lightgbm-r -f dockerfile-r .
``` ```
This will default to the latest version of R. If you want to try with an older `rocker` container to run a particular version of R, pass in a build arg with [a valid tag](https://hub.docker.com/r/rocker/verse/tags).
For example, to test with R 3.5:
```
docker build \
-t lightgbm-r-35 \
-f dockerfile-r \
--build-arg R_VERSION=3.5 \
.
```
After the build is finished you have two options to run the container: 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. 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.
......
FROM rocker/verse:latest ARG R_VERSION=latest
FROM rocker/verse:${R_VERSION}
WORKDIR /lgbm WORKDIR /lgbm
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y build-essential && \ apt-get install -y build-essential cmake && \
git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \
cd LightGBM && \ cd LightGBM && \
Rscript build_r.R 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