Skip to content

Commit e6f14e2

Browse files
author
Greg Van Liew
committed
2 parents a04b2ba + 402e64a commit e6f14e2

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

api/advanced-topics/remote-extensions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ Follow these steps:
4444
4545
### Debugging your extension in a remote environment
4646

47+
Normally when you build an extension, you edit, launch, and debug it all on your local machine. Debugging your extension in a remote environment follows this same pattern. You will just edit, launch, and debug your extension all on a remote machine, container, or in WSL instead of your local machine.
48+
4749
#### Using a development container
4850

4951
You can edit and debug your extension in a container by following these steps.
5052

51-
1. Add the Node.js dev container definition to your extension folder by pressing `kbstyle(F1)`, selecting the **Remote-Containers: Create Configuration File...** command, and picking **Node.js 8 & TypeScript** (or just Node.js 8 if you are not using TypeScript).
53+
1. Add the Node.js dev container definition to your extension folder by pressing `kbstyle(F1)`, selecting the **Remote-Containers: Create Configuration File...** command, and picking **Node.js 8 & TypeScript** (or just Node.js 8 if you are not using TypeScript). This will define the container you will use edit, debug, and test the extension.
5254

5355
2. After this command runs, you can modify the contents of the `.devcontainer` folder to include additional build or runtime requirements. See the [in-depth Remote-Containers documentation](/docs/remote/containers#_indepth-setting-up-a-folder-to-run-in-a-container) for details.
5456

@@ -71,9 +73,9 @@ You can edit and debug your extension in a container by following these steps.
7173
}
7274
```
7375

74-
4. Run **Remote-Containers: Reopen Folder in Container** and in a moment, VS Code will set up the container and connect. You can now edit your source code as you would in the local case.
76+
4. Run **Remote-Containers: Reopen Folder in Container** and in a moment, VS Code will set up the container and connect. You will now be able to develop your source code from inside the container just as you would in the local case.
7577

76-
5. Finally, press `kbstyle(F5)` or use the **Debug view** to launch the extension and attach the debugger as you would locally. The window that appears now contains your extension running inside this same container with the debugger attached to it.
78+
5. Finally, press `kbstyle(F5)` or use the **Debug view** to launch the extension inside this same container and attach the debugger. You will be able to interact with it just as you would in the local case, but from inside the development container you defined in step 1 instead.
7779

7880
#### Using SSH or WSL
7981

docs/remote/troubleshooting.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ icacls "%FILEORFOLDERTOUPDATE%" /c /inheritance:r /grant %USERDOMAIN%\%USERNAME%
237237
|----|--------------|---|
238238
| Debian / Ubuntu | Run `sudo apt-get install openssh-server` | See the [Ubuntu SSH](https://help.ubuntu.com/community/SSH?action=show) documentation for additional setup instructions. |
239239
| RHEL / Fedora / CentOS | Run `sudo yum install openssh-server && sudo systemctl start sshd.service && sudo systemctl enable sshd.service` | You may need to omit `sudo` when running in a container. |
240-
| macOS | Go to **System Preferences** > **Sharing**, check **Remote Login**. ||
241240

242241
## Container tips
243242

@@ -400,7 +399,7 @@ You can use Docker and Kubernetes related CLIs and extensions from inside your d
400399

401400
### Adding a non-root user to your dev container
402401

403-
Many images run as a root user by default. However, some provide non-root users, that you can optionally use instead. If your image or Dockerfile provides a non-root user that you can opt into using (for example, the default is still root), you can specify the user in one of two ways:
402+
Many images run as a root user by default. However, some provide one or more non-root users, that you can optionally use instead. If your image or Dockerfile provides a non-root user (but still defaults to root), you can opt into using it in one of two ways:
404403

405404
- When referencing an `image` or `Dockerfile`, add the following to your `devcontainer.json`:
406405

@@ -414,9 +413,7 @@ Many images run as a root user by default. However, some provide non-root users,
414413
user: user-name-goes-here
415414
```
416415

417-
Note that you do not need to do this if the default behavior of the container is to use the non-root user.
418-
419-
For images that only provide a root user, you can automatically create a non-root user in the `Dockerfile`. For example, this snippet will create a user called `user-name-goes-here` and give it the ability to use `sudo`:
416+
For images that only provide a root user, you can automatically create a non-root user by using a `Dockerfile`. For example, this snippet will create a user called `user-name-goes-here`, give it the ability to use `sudo`, and set it as the default:
420417

421418
```Dockerfile
422419
ARG USERNAME=user-name-goes-here
@@ -496,7 +493,7 @@ This warning is just that, a warning. It is telling you not to parse the output
496493
This occurs in `Dockerfile`s because the `apt-key` command is not running from a terminal. Unfortunately, this error cannot be eliminated completely, but can be hidden unless the `apt-key` command returns a non-zero exit code (indicating a failure). For example:
497494

498495
```Dockerfile
499-
# (OUT=$(apt-key add - 2>&1) || echo $OUT) will only print the output if a non-zero exit code is hit
496+
# (OUT=$(apt-key add - 2>&1) || echo $OUT) will only print the output with non-zero exit code is hit
500497
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | (OUT=$(apt-key add - 2>&1) || echo $OUT)
501498
```
502499

0 commit comments

Comments
 (0)