Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit a31934c

Browse files
committed
2 parents 2dd2fb2 + 0d92d39 commit a31934c

File tree

19 files changed

+141
-60
lines changed

19 files changed

+141
-60
lines changed

README.md

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,43 @@
1-
# Visual Studio Code Remote Development Container Definitions
1+
# VS Code Remote Development Container Definitions
22

3-
A **development container** is a running container that comes with a basic tool stack (Python, node, Go, etc.) and its prerequisites (e.g. `pylint` for Python). This container may be used to actually run an application or be focused exclusively on sandboxing tools, libraries, runtimes, or other utilities that need to be run against a codebase.
3+
<table style="width: 100%; border-style: none;"><tr>
4+
<td style="width: 140px; text-align: center;"><a href="https://aka.ms/vscode-remote/download/extension"><img width="128px" src="https://microsoft.github.io/vscode-remote-release/images/remote-extensionpack.png" alt="Visual Studio Code logo"/></a></td>
5+
<td>
6+
<strong>Visual Studio Code Remote Development</strong><br />
7+
<i>Open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set. <strong><a href="https://aka.ms/vscode-remote">Learn more!</a></strong><br />
8+
<strong><a href="https://aka.ms/vscode-remote/download/extension"><img src="https://microsoft.github.io/vscode-remote-release//images/download.png" alt="Download now!"/></a></strong></i>
9+
</td>
10+
</tr></table>
411

5-
The Containers extension in the [Visual Studio Code Remote Development](https://aka.ms/vscode-remote/download/extension) extension pack allows you to open any folder inside (or mounted into) a dev container and take advantage of VS Code's full feature set. When using the capability, VS Code selectively runs certain extensions in the container to optimize your experience. The result is that VS Code can provide a local-quality development experience including full IntelliSense, debugging, and more regardless of where your code is hosted.
12+
A **development container** is a running container that comes with a basic tool stack (Python, node, Go, etc.) and its prerequisites. The Remote - Containers extension in the [Remote Development](https://aka.ms/vscode-remote/download/extension) extension pack allows you to open any folder inside (or mounted into) a dev container and take advantage of VS Code's full feature set.
613

7-
**[Learn more about the Visual Studio Code Remote - Containers extension](https://aka.ms/vscode-remote/containers)**.
14+
This repository contains a set of **dev container definitions** to help get you up and running in a containerized environment. They describe the needed container image, any runtime arguments for starting the container, and any VS Code extensions that should be installed into it. They're can help you get started or be used as examples for adapting your own configuration to different situations.
815

9-
This repository contains a set of **dev container definitions** made up of files like `devcontainer.json` to help get you up and running in a containerized environment. These definitions describe the needed container image, any runtime arguments for starting the container, and any VS Code extensions that should be installed into it. They're can be useful to help you get started or as samples for how to adapt your own configuration to different situations.
16+
## Using a definition
1017

11-
## Trying a definition
18+
To add a dev container definition in your project, you can either:
1219

13-
1. Click on one of the `containers` sub-folders to open it in your browser
14-
2. Check out the README to see if there are any manual steps
15-
3. Clone this repository or copy the contents of the folder to your machine
16-
4. Run the **Remote-Containers: Open Folder in Container...** command in VS Code
17-
5. Select the root of the definition folder in the "open" dialog (**not** the `test-project` folder if present)
20+
- Add them using VS Code:
21+
22+
1. If this is your first time creating a dev container, follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to configure your machine.
23+
2. Start VS Code and open your project folder.
24+
3. Press <kbd>F1</kbd>
25+
and select either the **Remote-Containers: Create Container Configuration File...** or **Remote-Containers: Reopen Folder in Container** commands.
26+
4. Follow the directions and pick a development container definition when the list appears.
1827

19-
Many definitions include a `test-project` with a sample and/or launch settings in the `.vscode` folder that you can use to see the dev container in action.
28+
- Or manually copy the contents of one of folders in the `containers` directory into your project. Typically you can just copy the `.devcontainer` folder ignore everything else. See the definition's `README` for details.
2029

21-
## Using a definition
30+
## Trying a definition
2231

23-
You can either:
32+
If you want to try out a definition before choosing one:
2433

25-
- Open a folder in VS Code without a `devcontainer.json` file and run the **Remote-Containers: Create Container Configuration File...** or **Remote-Containers: Reopen Folder in Container** commands. You be prompted to pick a definition and any options and the appropriate files will then be added to your project.
34+
1. If this is your first time creating a dev container, follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to configure your machine.
35+
2. Browse the contents of the `containers` folder in this repository and pick one. Check out the `README` to see if there are any manual setup steps you should be aware of before continuing.
36+
3. Clone this repository locally.
37+
4. Start VS Code, press <kbd>F1</kbd>, and run the **Remote-Containers: Open Folder in Container...** command.
38+
5. Select the root of the definition folder from the cloned repository when prompted (**not** the `test-project` folder if present).
2639

27-
- Manually copy the contents of one of the `containers` sub-folders into your project. Typically you can just copy the `.devcontainer` folder into your project but the folder's README may mention additional files.
40+
Many definitions include a `test-project` with a sample and/or launch settings in the `.vscode` folder that you can use to see the dev container in action. See the definition's `README` for details.
2841

2942
## Adding a definition to an existing public or private repo
3043

@@ -38,19 +51,15 @@ Beyond the advantages of having your team use a consistent environment and tool-
3851
- `container-templates` - Contains templates for creating your own container definitions for your project or to [contribute back](CONTRIBUTING.md#contributing-dev-container-definitions).
3952
- `repository-containers` - Dev container definitions for working on a cloned copy of specific, public source code repository (rather than general purpose).
4053

41-
## Common Questions
42-
43-
### Can I just reuse an existing container image or Docker configuration?
44-
45-
Absolutely! If you want to use an existing Dockerfile as a starting point, run **Remote-Containers: Create Container Configuration File...** from the command pallette (Cmd/Ctrl+Shift+P). You'll be prompted to select a Dockerfile or you can opt to use a base image instead and customize from there.
54+
### Common Questions
4655

47-
You can also check out the [existing Dockerfile](containers/docker-existing-dockerfile) and [existing Docker Compose](containers/docker-existing-docker-compose) definitions for an example `devcontainer.json` . If none of these options meet your needs, you can start up the container any way you see fit and [attach to it](https://aka.ms/vscode-remote/containers/attach) instead.
56+
#### Can I just reuse an existing container image or Docker / Docker Compose configuration?
4857

49-
### What is the goal of `devcontainer.json`?
58+
Yes! If you want to use an existing Dockerfile as a starting point, run **Remote-Containers: Create Container Configuration File...** from the command pallette (Cmd/Ctrl+Shift+P). You'll be prompted to select a Dockerfile or Docker Compose file and customize from there. If you prefer, you can also you can start up the container any way you see fit and [attach to it](https://aka.ms/vscode-remote/containers/attach) instead.
5059

51-
The intent of `devcontainer.json` is conceptually similar to VS Code's `launch.json` for debugging, but designed to launch (or attach to) your development container instead. At its simplest, all you need to do is add a `.devcontainer/devcontainer.json` file to your project and reference an image, `Dockerfile`, or `docker-compose.yml` and a few properties.
60+
#### What is the goal of `devcontainer.json`?
5261

53-
Check out the `container-templates` folder for simple starter templates. The definitions in the `containers` folder can be used as-is or as samples for how to modify your existing config to support different scenarios. From there, you can [alter your configuration](https://aka.ms/vscode-remote/containers/folder-setup) to install additional tools like Git in the container, automatically install other extensions, expose additional ports, set runtime arguments, and more.
62+
The intent of `devcontainer.json` is similar to `launch.json` for debugging, but designed to launch (or attach to) a development container instead. At its simplest, all you need to do is add a `.devcontainer/devcontainer.json` file to your project that references an image, `Dockerfile`, or `docker-compose.yml`, and a few properties. You can [adapt it for use](https://aka.ms/vscode-remote/containers/folder-setup) in a wide variety of situations.
5463

5564
## Contributing & Feedback
5665

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/test-project/aspnetapp.csproj"
11+
],
12+
"problemMatcher": "$tsc"
13+
},
14+
{
15+
"label": "publish",
16+
"command": "dotnet",
17+
"type": "process",
18+
"args": [
19+
"publish",
20+
"${workspaceFolder}/test-project/aspnetapp.csproj"
21+
],
22+
"problemMatcher": "$tsc"
23+
},
24+
{
25+
"label": "watch",
26+
"command": "dotnet",
27+
"type": "process",
28+
"args": [
29+
"watch",
30+
"run",
31+
"${workspaceFolder}/test-project/aspnetapp.csproj"
32+
],
33+
"problemMatcher": "$tsc"
34+
}
35+
]
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/test-project/aspnetapp.csproj"
11+
],
12+
"problemMatcher": "$tsc"
13+
},
14+
{
15+
"label": "publish",
16+
"command": "dotnet",
17+
"type": "process",
18+
"args": [
19+
"publish",
20+
"${workspaceFolder}/test-project/aspnetapp.csproj"
21+
],
22+
"problemMatcher": "$tsc"
23+
},
24+
{
25+
"label": "watch",
26+
"command": "dotnet",
27+
"type": "process",
28+
"args": [
29+
"watch",
30+
"run",
31+
"${workspaceFolder}/test-project/aspnetapp.csproj"
32+
],
33+
"problemMatcher": "$tsc"
34+
}
35+
]
36+
}

containers/dotnetcore-latest/test-project/aspnetapp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<UserSecretsId>31051026529000467138</UserSecretsId>
66
</PropertyGroup>
77

containers/go/.devcontainer/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ RUN go get -u -v \
2323
github.com/mgechev/revive \
2424
github.com/derekparker/delve/cmd/dlv
2525

26+
# gocode-gomod
27+
RUN go get -x -d github.com/stamblerre/gocode \
28+
&& go build -o gocode-gomod github.com/stamblerre/gocode \
29+
&& mv gocode-gomod $GOPATH/bin/
30+
31+
# Copy default endpoint specific user settings overrides into container to specify Python path
32+
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
33+
2634
# Install git, process tools
2735
RUN apt-get update && apt-get -y install git procps
2836

2937
# Clean up
3038
RUN apt-get autoremove -y \
3139
&& apt-get clean -y \
3240
&& rm -rf /var/lib/apt/lists/*
33-
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"go.gopath": "/go"
3+
}

containers/plantuml/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See LICENSE in the project root for license information.
44
#-----------------------------------------------------------------------------------------
55

6-
FROM java:11
6+
FROM openjdk:8
77

88
# Install git, process tools
99
RUN apt-get update && apt-get -y install git procps

containers/plantuml/README.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Summary
44

5-
*Use PlantUML without installing all the dependencies locally. Includes Java, GraphViz, and the PlantUML extension.*
5+
*Demonstrates using PlantUML local rendering without installing dependencies. Includes Java, GraphViz, and the PlantUML extension.*
66

77
| Metadata | Value |
88
|----------|-------|
@@ -12,27 +12,13 @@
1212

1313
## Usage
1414

15-
First, install the **[Visual Studio Code Remote Development](https://aka.ms/vscode-remote/download/extension)** extension pack if you have not already.
15+
[See here for information on using this and other definitions in your project](../../README.md#using-a-definition). There are no addtional steps required.
1616

17-
To use the definition with your own project:
17+
### Try it
1818

19-
1. Copy the `.devcontainer` folder into your project root.
20-
2. Reopen the folder in the container (e.g. using the **Remote-Container: Reopen Folder in Container** command in VS Code) to use it unmodified.
21-
22-
If you prefer, you can look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
23-
24-
If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder.
25-
26-
Check out the samples folder or just do a markdown preview on this file once you've opened this folder in the container!
27-
28-
```plantuml
29-
@startuml
30-
Brain -> Brain: Wait, VS Code can do that?
31-
Brain -> Mouth: Say "Cool!"
32-
Mouth -> Ear: Cool!
33-
Ear -> Brain: Heard myself say Cool!
34-
@enduml
35-
````
19+
1. Run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of this entire folder.
20+
2. The container will build and VS Code will connect.
21+
3. Open `sample.plantuml` in the `test-project` folder and hit Alt-D.
3622

3723
## License
3824

containers/plantuml/test-project/markdown-sample.md renamed to containers/plantuml/test-project/markdownsample.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Markdown Sample
32

43
Open the markdown preview to check it out!

containers/rust/Cargo.lock

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)