Skip to content

Commit 643cce3

Browse files
committed
Add remote containers config
1 parent 93abc38 commit 643cce3

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
FROM mcr.microsoft.com/dotnet/core/sdk:2.1
7+
8+
# Avoid warnings by switching to noninteractive
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
# Or your actual UID, GID on Linux if not the default 1000
12+
ARG USERNAME=vscode
13+
ARG USER_UID=1000
14+
ARG USER_GID=$USER_UID
15+
16+
# Configure apt and install packages
17+
RUN apt-get update \
18+
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
19+
#
20+
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
21+
&& apt-get -y install git procps lsb-release \
22+
#
23+
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
24+
&& groupadd --gid $USER_GID $USERNAME \
25+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
26+
# [Optional] Uncomment the next three lines to add sudo support
27+
# && apt-get install -y sudo \
28+
# && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
29+
# && chmod 0440 /etc/sudoers.d/$USERNAME \
30+
#
31+
# Clean up
32+
&& apt-get autoremove -y \
33+
&& apt-get clean -y \
34+
&& rm -rf /var/lib/apt/lists/*
35+
36+
# Switch back to dialog for any ad-hoc use of apt-get
37+
ENV DEBIAN_FRONTEND=

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
2+
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/dotnetcore-2.1
3+
{
4+
"name": "C# (.NET Core 2.1)",
5+
"dockerFile": "Dockerfile",
6+
7+
// Uncomment the next line if you want to publish any ports.
8+
// "appPort": [],
9+
10+
// Uncomment the next line if you want to add in default container specific settings.json values
11+
// "settings": { "workbench.colorTheme": "Quiet Light" },
12+
13+
// Uncomment the next line to run commands after the container is created.
14+
// "postCreateCommand": "dotnet restore"
15+
16+
// Uncomment the next line to use a non-root user. See https://aka.ms/vscode-remote/containers/non-root-user.
17+
// "runArgs": [ "-u", "1000" ],
18+
19+
"extensions": [
20+
"ms-vscode.csharp"
21+
]
22+
}

0 commit comments

Comments
 (0)