Skip to content

Commit

Permalink
Merge dev container configs (microsoft/vscode-remote-release#8994)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Oct 3, 2023
1 parent 73cc570 commit 01edf51
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 334 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN /root/install-vscode.sh
RUN git config --system codespaces-theme.hide-status 1

USER node
RUN npm install -g node-gyp
RUN YARN_CACHE="$(yarn cache dir)" && rm -rf "$YARN_CACHE" && ln -s /vscode-dev/yarn-cache "$YARN_CACHE"

USER root
Expand Down
38 changes: 30 additions & 8 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Code - OSS Development Container

This dev container includes configuration for a development container for working with Code - OSS in a local container. For using [GitHub Codespaces](https://github.com/features/codespaces) follow the [prebuilt setup](prebuilt/README.md) which installs VNC for displaying the application window.
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode:https://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode)

> **Note:** You will need X11's `DISPLAY` or Wayland's `WAYLAND_DISPLAY` environment variable set locally to allow for the Code - OSS window to display. See [Running GUI app on WSL](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for Windows and [Quartz](https://www.xquartz.org) for Mac.
This repository includes configuration for a development container for working with Code - OSS in a local container or using [GitHub Codespaces](https://github.com/features/codespaces).

## Quick start
## Quick start - local

If you already have VS Code and Docker installed, you can click the badge above or [here](https://vscode.dev/redirect?url=vscode:https://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.

1. Install Docker Desktop or Docker for Linux on your local machine. (See [docs](https://aka.ms/vscode-remote/containers/getting-started) for additional details.)

Expand All @@ -24,17 +26,17 @@ This dev container includes configuration for a development container for workin
- Use the WSL extension for VS Code to open the cloned folder in WSL.
- Press <kbd>F1</kbd> and select **Dev Containers: Reopen in Container**.

Next: **[Try it out!](#try-it)**
> **Note:** For developing the desktop app locally, you will need X11's `DISPLAY` or Wayland's `WAYLAND_DISPLAY` environment variable set to allow for the Code - OSS window to display. See [Running GUI app on WSL](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for Windows and [Quartz](https://www.xquartz.org) for Mac.
## Try it
### Try it

To start working with Code - OSS, follow these steps:

1. In your local VS Code client, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:

```bash
yarn install
bash scripts/code.sh
./scripts/code.sh
```

2. You should now see Code - OSS!
Expand All @@ -45,12 +47,32 @@ Next, let's try debugging.
2. Go to your local VS Code client, and use the **Run / Debug** view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../../.vscode/launch.json). However, running `scripts/code.sh` first will set up Electron which will usually solve timeout issues.
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../../.vscode/launch.json). However, running `./scripts/code.sh` first will set up Electron which will usually solve timeout issues.
3. After a bit, Code - OSS will appear with the debugger attached!
Enjoy!
## Notes
### Notes
The container comes with VS Code Insiders installed. To run it from an Integrated Terminal use `VSCODE_IPC_HOOK_CLI= /usr/bin/code-insiders .`.
## Quick start - GitHub Codespaces
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and then click on **New codespace**. If prompted, select the **Standard** machine size (which is also the default).
> **Note:** You will not see these options within GitHub if you are not in the Codespaces beta.
### Try it
To start working with Code - OSS Web, follow these steps:
1. Open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
```bash
yarn install
yarn compile && yarn compile-web
./scripts/code-web.sh
```
2. You should now see Code - OSS Web open in your browser!
15 changes: 14 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Code - OSS with X11/Wayland",
"name": "Code - OSS",
"build": {
"dockerfile": "Dockerfile"
},
Expand All @@ -12,11 +12,24 @@
"type": "volume"
}
],
"postCreateCommand": "./.devcontainer/post-create.sh",
"customizations": {
"vscode": {
"settings": {
"resmon.show.battery": false,
"resmon.show.cpufreq": false
},
"extensions": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"ms-vscode.vscode-github-issue-notebooks",
"ms-vscode.vscode-selfhost-test-provider",
"mutantdino.resourcemonitor"
]
}
},
"hostRequirements": {
"memory": "9gb"
}
}
4 changes: 4 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

yarn install --network-timeout 180000
yarn electron
108 changes: 0 additions & 108 deletions .devcontainer/prebuilt/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions .devcontainer/prebuilt/cache/before-cache.sh

This file was deleted.

28 changes: 0 additions & 28 deletions .devcontainer/prebuilt/cache/build-cache-image.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .devcontainer/prebuilt/cache/cache-diff.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .devcontainer/prebuilt/cache/cache.Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions .devcontainer/prebuilt/cache/restore-diff.sh

This file was deleted.

44 changes: 0 additions & 44 deletions .devcontainer/prebuilt/devcontainer.json

This file was deleted.

Loading

0 comments on commit 01edf51

Please sign in to comment.