Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 2bbf7aa

Browse files
authored
Add docs and configs for VS Code (#60)
* Add .devcontainer to .gitignore * Add VS Code docs and configs * Add extensions.json * Refine docs * Update README.md
1 parent 24ef68c commit 2bbf7aa

File tree

9 files changed

+654
-3
lines changed

9 files changed

+654
-3
lines changed

.devcontainer.example/Dockerfile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:5.0
2+
3+
# [Option] Install zsh
4+
ARG INSTALL_ZSH="true"
5+
# [Option] Upgrade OS packages to their latest versions
6+
ARG UPGRADE_PACKAGES="false"
7+
# [Option] Enable non-root Docker access in container
8+
ARG ENABLE_NONROOT_DOCKER="true"
9+
# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine
10+
ARG USE_MOBY="true"
11+
12+
# Install needed packages and setup non-root user. Use a separate RUN statement to add your
13+
# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists.
14+
ARG USERNAME=automatic
15+
ARG USER_UID=1000
16+
ARG USER_GID=$USER_UID
17+
COPY library-scripts/*.sh /tmp/library-scripts/
18+
RUN apt-get update \
19+
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
20+
# Use Docker script from script library to set things up
21+
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" \
22+
# Clean up
23+
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/
24+
25+
VOLUME [ "/var/lib/docker" ]
26+
27+
# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
28+
# inside the container "overrideCommand": false is set in devcontainer.json.
29+
# The script will also execute CMD if you need to alter startup behaviors.
30+
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
31+
CMD [ "sleep", "infinity" ]
32+
33+
# Instructions to install latest Mono from
34+
# https://www.mono-project.com/download/stable/#download-lin-debian
35+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
36+
echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
37+
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
38+
mono-complete
39+
40+
# Instructions to install .NET Core runtimes from
41+
# https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-debian10
42+
RUN wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
43+
dpkg -i packages-microsoft-prod.deb && \
44+
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
45+
apt-transport-https \
46+
aspnetcore-runtime-2.1 \
47+
aspnetcore-runtime-3.0 \
48+
aspnetcore-runtime-3.1
49+
50+
# [Optional] Uncomment this section to install additional OS packages.
51+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
52+
# && apt-get -y install --no-install-recommends <your-package-list-here>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/docker-in-docker
3+
{
4+
"name": "Docker in Docker",
5+
"dockerFile": "Dockerfile",
6+
"runArgs": ["--init", "--privileged"],
7+
"overrideCommand": false,
8+
9+
// Use this environment variable if you need to bind mount your local source code into a new container.
10+
// Set *default* container specific settings.json values on container create.
11+
"settings": {
12+
"terminal.integrated.shell.linux": "/bin/zsh"
13+
},
14+
15+
// Add the IDs of extensions you want installed when the container is created.
16+
"extensions": [
17+
"ms-azuretools.vscode-docker",
18+
"ms-dotnettools.csharp"
19+
],
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
"postCreateCommand": "dotnet build Datadog.Trace.Minimal.sln || true",
26+
27+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
28+
// "remoteUser": "vscode"
29+
}

0 commit comments

Comments
 (0)