forked from home-assistant/addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify devcontainer setup (home-assistant#1687)
* Simplify devcontainer setup * Add stable shellcheck * Fix observer port
- Loading branch information
Showing
4 changed files
with
67 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,34 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian-10 | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian | ||
|
||
WORKDIR /workspaces | ||
|
||
# Default ENV | ||
ENV LANG C.UTF-8 | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Set shell | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# Install docker | ||
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
software-properties-common \ | ||
gnupg \ | ||
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ | ||
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ | ||
&& apt-get update && apt-get install -y --no-install-recommends \ | ||
docker-ce \ | ||
docker-ce-cli \ | ||
containerd.io \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Set Docker daemon config | ||
RUN \ | ||
mkdir -p /etc/docker \ | ||
&& echo '{"storage-driver": "vfs"}' > /etc/docker/daemon.json | ||
|
||
# Install tools | ||
ARG SHELLCHECK_VERSION=0.7.0 | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
jq \ | ||
# Installa aditional tools | ||
RUN \ | ||
apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
dbus \ | ||
network-manager \ | ||
libpulse0 \ | ||
git \ | ||
tar \ | ||
xz-utils \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
xz-utils | ||
|
||
# Install docker | ||
RUN curl -fsSL https://get.docker.com | sh - | ||
|
||
# Install shellcheck | ||
RUN \ | ||
curl -fLs \ | ||
"https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" \ | ||
| tar -xJ \ | ||
\ | ||
&& curl -SL "https://storage.googleapis.com/shellcheck/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar xJf - \ | ||
&& cp "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ \ | ||
&& rm -rf shellcheck-v${SHELLCHECK_VERSION} | ||
&& mv -f "./shellcheck-stable/shellcheck" "/usr/bin/shellcheck" \ | ||
&& rm -rf "./shellcheck-stable" | ||
|
||
# Generate a machine-id for this container | ||
RUN rm /etc/machine-id && dbus-uuidgen --ensure=/etc/machine-id | ||
|
||
ENV DEBIAN_FRONTEND=dialog | ||
RUN rm /etc/machine-id && dbus-uuidgen --ensure=/etc/machine-id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters