Skip to content

Commit 1ff5b9a

Browse files
authored
Merge pull request #89 from carpentries/frog-devcon-1
Update devcontainer with mounts and user specification
2 parents 93e0370 + 249e2a1 commit 1ff5b9a

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
FROM carpentries/workbench-docker:latest
22

3-
RUN Rscript -e 'sandpaper::use_package_cache(prompt = FALSE)'
4-
5-
COPY renv/profiles/lesson-requirements/renv.lock .
6-
RUN Rscript -e 'renv::restore(prompt = FALSE)'
3+
## this could be used to run userland scripts e.g.
4+
## users could add specific dependencies or configurations
5+
## RUN scripts/userland.sh

.devcontainer/devcontainer.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
{
2-
"build": { "dockerfile": "Dockerfile", "context": ".." }
2+
"remoteUser":"rstudio",
3+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/rstudio/lesson,type=bind",
4+
"workspaceFolder": "/home/rstudio/lesson",
5+
"mounts": [
6+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/rstudio/.ssh,type=bind,consistency=cached",
7+
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gnupg,target=/home/rstudio/.gnupg,type=bind,consistency=cached"
8+
],
9+
"build": {
10+
"dockerfile": "Dockerfile",
11+
"context": ".."
12+
},
13+
"postCreateCommand": {
14+
"pre_echo": "echo 'Installing lesson prerequisites - please wait...'",
15+
"lesson_deps": "Rscript /home/rstudio/.workbench/setup_lesson_deps.R",
16+
"fortify": "Rscript /home/rstudio/.workbench/fortify_renv_cache.R"
17+
}
318
}

0 commit comments

Comments
 (0)