Skip to content

Commit 724ac17

Browse files
authored
Merge pull request #1451 from rgaiacs/1450-fix-vanilla
Replace --vanilla with --no-init-file
2 parents 2552e01 + 673e1bd commit 724ac17

File tree

1 file changed

+5
-5
lines changed
  • repo2docker/buildpacks

1 file changed

+5
-5
lines changed

repo2docker/buildpacks/r.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ def get_build_scripts(self):
358358
# Install a pinned version of devtools, IRKernel and shiny
359359
rf"""
360360
export EXPANDED_CRAN_MIRROR_URL="$(. /etc/os-release && echo {cran_mirror_url} | envsubst)" && \
361-
R --vanilla --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && \
362-
R --vanilla --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))"
361+
R --no-save --no-restore --no-init-file --no-environ --quiet -e "install.packages(c('devtools', 'IRkernel', 'shiny'), repos=Sys.getenv(\"EXPANDED_CRAN_MIRROR_URL\"))" && \
362+
R --no-save --no-restore --no-init-file --no-environ --quiet -e "IRkernel::installspec(prefix=Sys.getenv(\"NB_PYTHON_PREFIX\"))"
363363
""",
364364
),
365365
]
@@ -395,7 +395,7 @@ def get_preassemble_scripts(self):
395395
"${NB_USER}",
396396
# Delete /tmp/downloaded_packages only if install.R fails, as the second
397397
# invocation of install.R might be able to reuse them
398-
f"Rscript --vanilla {installR_path} && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages",
398+
f"Rscript --no-save --no-restore --no-init-file --no-environ {installR_path} && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages",
399399
)
400400
]
401401

@@ -413,7 +413,7 @@ def get_assemble_scripts(self):
413413
"${NB_USER}",
414414
# only run install.R if the pre-assembly failed
415415
# Delete any downloaded packages in /tmp, as they aren't reused by R
416-
f"""if [ ! -f /tmp/.preassembled ]; then Rscript --vanilla {installR_path}; rm -rf /tmp/downloaded_packages; fi""",
416+
f"""if [ ! -f /tmp/.preassembled ]; then Rscript --no-save --no-restore --no-init-file --no-environ {installR_path}; rm -rf /tmp/downloaded_packages; fi""",
417417
)
418418
]
419419

@@ -422,7 +422,7 @@ def get_assemble_scripts(self):
422422
assemble_scripts += [
423423
(
424424
"${NB_USER}",
425-
'R --vanilla --quiet -e "devtools::install_local(getwd())"',
425+
'R --no-save --no-restore --no-init-file --no-environ --quiet -e "devtools::install_local(getwd())"',
426426
)
427427
]
428428

0 commit comments

Comments
 (0)