From bbceb49885c32eaf8a910b1a0448eda63eb2b65b Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Wed, 16 Nov 2022 11:23:50 -0600 Subject: [PATCH] Use latest template (#79) --- .devcontainer/Dockerfile | 15 --------------- .devcontainer/devcontainer.json | 31 +++++++++++++------------------ README.md | 2 +- azure-pipelines.yaml | 8 ++++++++ 4 files changed, 22 insertions(+), 34 deletions(-) delete mode 100644 .devcontainer/Dockerfile create mode 100644 azure-pipelines.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index cec255a..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/javascript-node/.devcontainer/base.Dockerfile -# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster -ARG VARIANT=16-bullseye -FROM mcr.microsoft.com/devcontainers/javascript-node:0-${VARIANT} - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment if you want to install an additional version of node using nvm -# ARG EXTRA_NODE_VERSION=10 -# RUN su node -c "umask 0002 && ./usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" - -# [Optional] Uncomment if you want to install more global node modules -# RUN su node -c "npm install -g " diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4726725..c4b82d1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,23 +1,18 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/javascript-node + +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node { "name": "Node.js", - "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick a Node version: 16, 14, 12. - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local arm64/Apple Silicon. - "args": { "VARIANT": "16-bullseye" } - }, + "image": "mcr.microsoft.com/devcontainers/javascript-node:16-bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": {}, - - // Add the IDs of extensions you want installed when the container is created. + "settings": {}, "extensions": [ "dbaeumer.vscode-eslint" ] @@ -27,22 +22,22 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [3000], - // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. + // Use 'portsAttributes' to set default properties for specific forwarded ports. "portsAttributes": { "3000": { "label": "Hello Remote World", "onAutoForward": "notify" } }, - + // Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'. // "otherPortsAttributes": { // "onAutoForward": "silent" // }, // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "yarn install", + "postCreateCommand": "yarn install" - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node" + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } diff --git a/README.md b/README.md index e9a9773..a394462 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Follow these steps to open this sample in a container using the VS Code Dev Cont Once you have this sample opened, you'll be able to work with it like you would locally. -> **Note:** This container runs as a non-root user with sudo access by default. Comment out `"remoteUser": "node"` in `.devcontainer/devcontainer.json` if you'd prefer to run as root. +> **Note:** This container runs as a non-root user with sudo access by default. Uncomment `"remoteUser": "root"` in `.devcontainer/devcontainer.json` if you'd prefer to run as root. Some things to try: diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml new file mode 100644 index 0000000..7f7bb42 --- /dev/null +++ b/azure-pipelines.yaml @@ -0,0 +1,8 @@ +pool: + vmImage: ubuntu-latest + +trigger: +- main + +variables: + Codeql.Enabled: true