Skip to content

Commit 3ba13ae

Browse files
committed
Add Dockerfile and devcontainer config
1 parent a8f9376 commit 3ba13ae

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

Diff for: Dockerfile

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM debian:stable-20200327-slim
2+
3+
ENV DENO_VERSION=1.0.1
4+
5+
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
6+
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
7+
# will be updated to match your local UID/GID (when using the dockerFile property).
8+
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
9+
ARG USERNAME=vscode
10+
ARG USER_UID=1000
11+
ARG USER_GID=$USER_UID
12+
13+
# Options for common package install script
14+
ARG INSTALL_ZSH="true"
15+
ARG UPGRADE_PACKAGES="true"
16+
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
17+
ARG COMMON_SCRIPT_SHA="dev-mode"
18+
19+
# Configure apt and install packages
20+
RUN apt-get update \
21+
&& export DEBIAN_FRONTEND=noninteractive \
22+
#
23+
# Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh
24+
&& apt-get -y install --no-install-recommends curl ca-certificates 2>&1 unzip \
25+
&& curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \
26+
&& ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \
27+
&& /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
28+
&& rm /tmp/common-setup.sh \
29+
# Install Deno
30+
&& curl -fsSL https://github.com/denoland/deno/releases/download/v${DENO_VERSION}/deno-x86_64-unknown-linux-gnu.zip \
31+
--output deno.zip \
32+
&& unzip deno.zip \
33+
&& rm deno.zip \
34+
&& chmod 777 deno \
35+
&& mv deno /usr/bin/deno \
36+
#
37+
# Clean up
38+
&& apt-get autoremove -y \
39+
&& apt-get clean -y \
40+
&& rm -rf /var/lib/apt/lists/*

Diff for: devcontainer.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "Deno & TypeScript",
3+
"dockerFile": "Dockerfile",
4+
// Set *default* container specific settings.json values on container create.
5+
"settings": {
6+
"terminal.integrated.shell.linux": "/bin/bash"
7+
},
8+
// Add the IDs of extensions you want installed when the container is created.
9+
"extensions": [
10+
"github.vscode-pull-request-github",
11+
"justjavac.vscode-deno",
12+
"ms-vscode.wordcount",
13+
"visualstudioexptteam.vscodeintellicode"
14+
]
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
// "postCreateCommand": "yarn install",
19+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
20+
// "remoteUser": "node"
21+
}

0 commit comments

Comments
 (0)