From e82a608a8dd0b02b38c1856d2c70a86cb9633ce9 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 8 May 2019 22:31:44 -0700 Subject: [PATCH] Add ability to open repo in a remote container. --- .devcontainer/Dockerfile | 34 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 9 +++++++++ 2 files changed, 43 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..ccc11547 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,34 @@ +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- + +FROM node:8-slim + +# Configure apt +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils 2>&1 + +# Verify git and needed tools are installed +RUN apt-get install -y git procps + +# Remove outdated yarn from /opt and install via package +# so it can be easily updated via apt-get upgrade yarn +RUN rm -rf /opt/yarn-* \ + rm -f /usr/local/bin/yarn \ + rm -f /usr/local/bin/yarnpkg \ + && apt-get install -y curl apt-transport-https lsb-release \ + && curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \ + && echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get -y install --no-install-recommends yarn + +# Install tslint and typescript +RUN npm install -g tslint typescript + +# Clean up +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* +ENV DEBIAN_FRONTEND=dialog diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..da1e96bc --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +// See https://aka.ms/vscode-remote/containers for the +// documentation about the devcontainer.json format +{ + "name": "Extension Development", + "dockerFile": "Dockerfile", + "extensions": [ + "ms-vscode.vscode-typescript-tslint-plugin" + ] +} \ No newline at end of file