You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .devcontainer/Dockerfile
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,17 @@
1
-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp/.devcontainer/base.Dockerfile
2
-
# [Choice] Debian / Ubuntu version (use Debian 11/9, Ubuntu 18.04/21.04 on local arm64/Apple Silicon): debian-11, debian-10, debian-9, ubuntu-21.04, ubuntu-20.04, ubuntu-18.04
3
-
ARG VARIANT=debian-11
4
-
FROM mcr.microsoft.com/devcontainers/cpp:0-${VARIANT}
1
+
FROM mcr.microsoft.com/devcontainers/cpp:0-debian-11
2
+
3
+
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none"
4
+
5
+
# Optionally install the cmake for vcpkg
6
+
COPY ./reinstall-cmake.sh /tmp/
7
+
8
+
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
Copy file name to clipboardExpand all lines: README.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-cpp)
4
4
5
-
A **development container** is a running [Docker](https://www.docker.com)container with a well-defined tool/runtime stack and its prerequisites. You can try out development containers with **[GitHub Codespaces](https://github.com/features/codespaces)** or **[Visual Studio Code Dev Containers](https://aka.ms/vscode-remote/containers)**.
5
+
A **development container** is a running container with a well-defined tool/runtime stack and its prerequisites. You can try out development containers with **[GitHub Codespaces](https://github.com/features/codespaces)** or **[Visual Studio Code Dev Containers](https://aka.ms/vscode-remote/containers)**.
6
6
7
7
This is a sample project that lets you try out either option in a few easy steps. We have a variety of other [vscode-remote-try-*](https://github.com/search?q=org%3Amicrosoft+vscode-remote-try-&type=Repositories) sample projects, too.
8
8
@@ -12,8 +12,9 @@ This is a sample project that lets you try out either option in a few easy steps
12
12
13
13
### GitHub Codespaces
14
14
Follow these steps to open this sample in a Codespace:
15
-
1. Click the Code drop-down menu and select the **Open with Codespaces** option.
16
-
1. Select **+ New codespace** at the bottom on the pane.
15
+
1. Click the **Code** drop-down menu.
16
+
2. Click on the **Codespaces** tab.
17
+
3. Click **Create codespace on main** .
17
18
18
19
For more info, check out the [GitHub documentation](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace#creating-a-codespace).
19
20
@@ -41,21 +42,29 @@ Follow these steps to open this sample in a container using the VS Code Dev Cont
41
42
42
43
Once you have this sample opened, you'll be able to work with it like you would locally.
43
44
44
-
> **Note:** This container runs as a non-root user with sudo access by default. Comment out `"remoteUser": "vscode"` in `.devcontainer/devcontainer.json` if you'd prefer to run as root.
45
-
46
45
Some things to try:
47
46
48
47
1.**Edit:**
49
48
- Open `main.cpp`
50
49
- Try adding some code and check out the language features.
51
-
- Notice that the C++ extension is already installed in the container since the `.devcontainer/devcontainer.json` lists `"ms-vscode.cpptools"` as an extension to install automatically when the container is created.
50
+
- Make a spelling mistake and notice it is detected. The [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) extension was automatically installed because it is referenced in `.devcontainer/devcontainer.json`.
51
+
- Also notice that utilities like `Vcpkg` and the [C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension are installed. Tools are installed in the `mcr.microsoft.com/devcontainers/cpp` image and Dev Container settings and metadata are automatically picked up from [image labels](https://containers.dev/implementors/reference/#labels).
52
+
52
53
1.**Terminal:** Press <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>\`</kbd> and type `uname` and other Linux commands from the terminal window.
54
+
53
55
1.**Build, Run, and Debug:**
54
56
- Open `main.cpp`
55
57
- Add a breakpoint (e.g. on line 7).
56
58
- Press <kbd>F5</kbd> to launch the app in the container.
57
59
- Once the breakpoint is hit, try hovering over variables, examining locals, and more.
58
60
61
+
1.**Install the GitHub CLI using a Dev Container Feature:**
62
+
- Press <kbd>F1</kbd> and select the **Dev Containers: Configure Container Features...** or **Codespaces: Configure Container Features...** command.
63
+
- Type "github" in the text box at the top.
64
+
- Check check box next to "GitHub CLI" (published by devcontainers)
65
+
- Click OK
66
+
- Press <kbd>F1</kbd> and select the **Dev Containers: Rebuild Container** or **Codespaces: Rebuild Container** command so the modifications are picked up.
67
+
59
68
## Contributing
60
69
61
70
This project welcomes contributions and suggestions. Most contributions require you to agree to a
0 commit comments