Skip to content

Commit a533714

Browse files
authoredJun 23, 2021
updating devcontainer to use dockerfile to install correct version of node and adds some other helpful extensions for working in docs (github#20059)
1 parent eba49ad commit a533714

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
 

‎.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 16, 14, 12
4+
ARG VARIANT="16-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install --no-install-recommends <your-package-list-here>
10+
11+
# [Optional] Uncomment if you want to install an additional version of node using nvm
12+
# ARG EXTRA_NODE_VERSION=10
13+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
14+
15+
# [Optional] Uncomment if you want to install more global node modules
16+
# RUN su node -c "npm install -g <your-package-list-here>"

‎.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.177.0/containers/javascript-node
3+
{
4+
"name": "docs.github.com",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 12, 14, 16
8+
"args": { "VARIANT": "16" }
9+
},
10+
11+
// Set *default* container specific settings.json values on container create.
12+
"settings": {
13+
"terminal.integrated.shell.linux": "/bin/bash",
14+
"cSpell.language": ",en"
15+
},
16+
17+
// Visual Studio Code extensions which help authoring for docs.github.com.
18+
"extensions": [
19+
"dbaeumer.vscode-eslint",
20+
"sissel.shopify-liquid",
21+
"davidanson.vscode-markdownlint",
22+
"bierner.markdown-preview-github-styles",
23+
"yzhang.markdown-all-in-one",
24+
"streetsidesoftware.code-spell-checker"
25+
],
26+
27+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28+
"forwardPorts": [4000],
29+
30+
// Use 'postCreateCommand' to run commands after the container is created.
31+
"postCreateCommand": "npm ci && npm run build",
32+
33+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
34+
"remoteUser": "node"
35+
}

0 commit comments

Comments
 (0)