Use Microsoft devcontainer base (#16407)

This commit is contained in:
Paulus Schoutsen 2021-02-04 11:24:51 +01:00 committed by GitHub
parent 09759662a1
commit d703d0a94f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 13 deletions

View File

@ -1,8 +1,8 @@
{ {
"name": "home-assistant.io", "name": "home-assistant.io",
"dockerFile": "Dockerfile", "dockerFile": "../Dockerfile",
"appPort": [4000], "appPort": [4000],
"postCreateCommand": "bundle install", "postCreateCommand": "bundle install && npm install",
"extensions": [ "extensions": [
"davidanson.vscode-markdownlint", "davidanson.vscode-markdownlint",
"editorconfig.editorconfig", "editorconfig.editorconfig",

View File

@ -1,10 +1,11 @@
FROM ruby:2.6 ARG VARIANT=2.6
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
# Avoid warnings by switching to noninteractive # Install node
ENV DEBIAN_FRONTEND=noninteractive COPY .nvmrc /tmp/.nvmrc
RUN \
# Use Bash as the default shell su vscode -c \
ENV SHELL=/bin/bash "source /usr/local/share/nvm/nvm.sh && nvm install $(cat /tmp/.nvmrc) 2>&1"
# Set an environment variable to be able to detect we are in dev container # Set an environment variable to be able to detect we are in dev container
ENV DEVCONTAINER=true ENV DEVCONTAINER=true
@ -16,7 +17,7 @@ ENV \
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
# Install git, process tools # Install git, process tools
RUN apt update \ RUN apt update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
ack \ ack \
git \ git \
@ -30,7 +31,5 @@ RUN apt update \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install the specific version of bundler we need # Install the specific version of bundler we need
RUN gem install bundler -v 2.0.1 COPY Gemfile.lock ./
RUN gem install bundler -v `awk 'c&&c--;/BUNDLED WITH/{c=1}' Gemfile.lock`
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog