-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
25 lines (12 loc) · 928 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM mcr.microsoft.com/windows/servercore:ltsc2019
ARG R_VERSION
RUN curl.exe -o rtools.exe https://cran.r-project.org/bin/windows/Rtools/rtools40-x86_64.exe && rtools.exe /VERYSILENT -NoNewWindow -Wait && del rtools.exe
RUN curl.exe -o R-%R_VERSION%-win.exe https://cran.r-project.org/bin/windows/base/old/%R_VERSION%/R-%R_VERSION%-win.exe && R-%R_VERSION%-win.exe /VERYSILENT /DIR="C:\R" && del R-%R_VERSION%-win.exe
RUN setx /M path "%path%;C:\R\bin;%RTOOLS40_HOME%\usr\bin"
ARG MRAN_DATE
RUN echo options(repos = c(MRAN = "https://mran.microsoft.com/snapshot/%MRAN_DATE%")) >> "C:\R\library\base\R\Rprofile"
USER ContainerUser
RUN echo "R_LIBS_USER=~/R/%p-library/%V" >> "%USERPROFILE%\Documents\.Renviron"
RUN Rscript -e "dir.create(Sys.getenv('R_LIBS_USER'), recursive = TRUE)"
RUN Rscript -e "install.packages('remotes'); unlink(file.path(Sys.getenv('TMP'), '*'), recursive = TRUE)"
CMD [ "R", "--no-save" ]