-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.devcontainer.json
More file actions
124 lines (101 loc) · 4.97 KB
/
.devcontainer.json
File metadata and controls
124 lines (101 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"name": "R dev (latest)",
// =====================================================================
// BUILD DOCKER IMAGE
// =====================================================================
// Dockerfile defines image to build
"build": {"dockerfile": "Dockerfile"},
// =====================================================================
// DEFINE MOUNTS
// =====================================================================
// Connect local and virtual filesystems with mounts
// "mounts": ["source=/path/to/source, target=/path/to/target"],
// =====================================================================
// FEATURES
// =====================================================================
// Predefined devcontainer features allow easy setup of features
"features": {
// -------------------------------------------------------------------
// ROCKER FEATURES
// -------------------------------------------------------------------
// Rocker provides a set of devcontainer features for R development:
// https://github.com/rocker-org/devcontainer-features/tree/main
// R (latest version)
"ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {
"installRadian": true // installs radian console with pip
},
// Setup renv cache for R packages using a docker volume
"ghcr.io/rocker-org/devcontainer-features/renv-cache:latest": {},
// R packages with pak::pak()
// In the current setup, I install some 'development-related' packages here, and 'project-related' packages from the dockerfile
// "ghcr.io/rocker-org/devcontainer-features/r-packages:latest": {
// "packages": "rlang, languageserver, remotes, cli, httpgd, rmarkdown",
// "installSystemRequirements": true
// },
// Install linux packages with apt
"ghcr.io/rocker-org/devcontainer-features/apt-packages:latest": {
"packages": "git, curl, wget, sudo"
},
// Install pandoc
"ghcr.io/rocker-org/devcontainer-features/pandoc:latest": {},
// Install quarto
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:latest": {},
// -------------------------------------------------------------------
// CLI FEATURES
// -------------------------------------------------------------------
// Command line utilities
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true
},
// ZSH plugins (downloaded here for simplicity; .zshrc is pulled from my .dotfiles repo in postCreateCommand)
"ghcr.io/devcontainers-contrib/features/zsh-plugins:latest": {
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git"
},
// Preserve shell history (incl. for zsh)
"ghcr.io/stuartleeks/dev-container-features/shell-history:latest": {}
},
// =====================================================================
// CUSTOMIZE DEV CONTAINER
// =====================================================================
"customizations": {
"vscode": {
"settings": {
"r.rterm.linux": "/usr/local/bin/radian",
"r.bracketedPaste": true,
"r.plot.useHttpgd": true,
"r.sessionWatcher": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh"
}
}
},
"extentions": [
"REditorSupport.r",
"quarto.quarto",
"ms-azuretools.vscode-docker",
"christian-kohler.path-intellisense",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-australian-english",
"streetsidesoftware.code-spell-checker-scientific-terms",
"mechatroner.rainbow-csv",
"AntiAntiSepticeye.vscode-color-picker",
"zhuangtongfa.material-theme"
]
}
},
// =====================================================================
// SCRIPTS TO RUN AFTER CONTAINER IS CREATED
// =====================================================================
// Install p10k oh-my-zsh theme
// Download config files from my .dotfiles repo
"postCreateCommand": "git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k && wget https://raw.githubusercontent.com/bfordAIMS/.dotfiles/main/.zshrc -O $HOME/.zshrc && wget https://raw.githubusercontent.com/bfordAIMS/.dotfiles/main/.p10k.zsh -O $HOME/.p10k.zsh"
}