Skip to content

Commit

Permalink
Fix Dockerfile for devcontainer (#17447)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh committed Apr 13, 2021
1 parent 63df6b8 commit 4ae7b8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 9 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"name": "home-assistant.io",
"context": "..",
"dockerFile": "../Dockerfile",
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"args": {
"VARIANT": "2.6",
"NODE_VERSION": "12.1",
}
},
"appPort": [4000],
"postCreateCommand": "bundle install && npm install",
"containerEnv": {"DEVCONTAINER": "true"},
Expand All @@ -21,4 +27,4 @@
"errorLens.enabledDiagnosticLevels": ["error", "warning"],
"terminal.integrated.shell.linux": "/usr/bin/zsh",
}
}
}
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
ARG VARIANT=2.6
ARG VARIANT=2
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}

# Install node
COPY .nvmrc /tmp/.nvmrc
RUN \
su vscode -c \
"source /usr/local/share/nvm/nvm.sh && nvm install $(cat /tmp/.nvmrc) 2>&1"
ARG NODE_VERSION="lts/*"
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"

# Locale env vars
ENV \
Expand All @@ -19,11 +16,8 @@ RUN \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ack \
&& echo "en_US UTF-8" > /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
&& locale-gen en_US.UTF-8

# Install the specific version of bundler we need
COPY Gemfile.lock ./
RUN gem install bundler -v `awk 'c&&c--;/BUNDLED WITH/{c=1}' Gemfile.lock`
RUN gem install bundler -v `awk 'c&&c--;/BUNDLED WITH/{c=1}' Gemfile.lock`

0 comments on commit 4ae7b8e

Please sign in to comment.