Skip to content

Commit dd961f1

Browse files
committed
Add devcontainers config
1 parent 5ab2600 commit dd961f1

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/ruby/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.1, 3.0, 2, 2.7, 3-bullseye, 3.1-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 3-buster, 3.1-buster, 3.0-buster, 2-buster, 2.7-buster
4+
ARG VARIANT="3.1-bullseye"
5+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
6+
7+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
8+
ARG NODE_VERSION="none"
9+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
10+
11+
# [Optional] Uncomment this section to install additional OS packages.
12+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
13+
# && apt-get -y install --no-install-recommends <your-package-list-here>
14+
15+
# [Optional] Uncomment this line to install additional gems.
16+
# RUN gem install <your-gem-names-here>
17+
18+
# [Optional] Uncomment this line to install global node packages.
19+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/ruby
3+
{
4+
"name": "Ruby",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a Ruby version: 3, 3.1, 3.0, 2, 2.7
9+
// Append -bullseye or -buster to pin to an OS version.
10+
// Use -bullseye variants on local on arm64/Apple Silicon.
11+
"VARIANT": "3-bullseye",
12+
// Options
13+
"NODE_VERSION": "lts/*"
14+
}
15+
},
16+
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
// Configure properties specific to VS Code.
20+
"vscode": {
21+
// Add the IDs of extensions you want installed when the container is created.
22+
"extensions": [
23+
"rebornix.Ruby"
24+
]
25+
}
26+
},
27+
28+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
29+
// "forwardPorts": [],
30+
31+
// Use 'postCreateCommand' to run commands after the container is created.
32+
// "postCreateCommand": "ruby --version",
33+
34+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
35+
"remoteUser": "vscode",
36+
"features": {
37+
"github-cli": "latest"
38+
}
39+
40+
}

0 commit comments

Comments
 (0)