microsoft/openvmm
Publicmirrored fromhttps://github.com/microsoft/openvmmAvailable
Guide/src/dev_guide/getting_started/devcontainer.md
52lines · modecode
| 1 | # Getting started via Dev Container |
| 2 | |
| 3 | This page provides instructions for setting up a development environment using |
| 4 | the repo provided Dev Container configuration for local development or |
| 5 | development using GitHub Codespaces. |
| 6 | |
| 7 | The repo provides an Ubuntu `devcontainer.json` that installs Rust and the |
| 8 | supported targets for the project. |
| 9 | |
| 10 | ## Developing using a GitHub Codespace |
| 11 | |
| 12 | Either create a GitHub Codespace via your fork by clicking on the `Code` box, or |
| 13 | visit the link [here](https://github.com/codespaces/new) and select your fork |
| 14 | and branch. |
| 15 | |
| 16 | If you plan on using rust-analyzer or doing any sort of dev work, it's |
| 17 | recommended to use an 8 core SKU or beefier. |
| 18 | |
| 19 | More documentation can be found at the official GitHub |
| 20 | [docs](https://docs.github.com/en/codespaces). |
| 21 | |
| 22 | ## Developing using a local dev container |
| 23 | |
| 24 | This will use Docker + the dev container vscode extension to launch the repo |
| 25 | provided `devcontainer.json` on your local machine. |
| 26 | |
| 27 | Follow the install instructions outlined |
| 28 | [here](https://code.visualstudio.com/docs/devcontainers/containers#_installation). |
| 29 | |
| 30 | From there, use the dev container extension in vscode to create a new dev |
| 31 | container for the repository. |
| 32 | |
| 33 | It's recommended to clone the repo _inside_ the dev container using the `Dev |
| 34 | Containers: Clone Repository Inside Container Volume...` command, as the |
| 35 | filesystem otherwise will be very slow over the bind mount, which will make your |
| 36 | builds & rust-analyzer very slow. |
| 37 | |
| 38 | More documentation can be found at the official vscode |
| 39 | [docs](https://code.visualstudio.com/docs/devcontainers/containers). |
| 40 | |
| 41 | ## Customizing your dev container |
| 42 | |
| 43 | Both GitHub codespaces and local dev containers support dotfile repos which can |
| 44 | be used to run personalized install scripts like installing your favorite tools |
| 45 | and shells, and copying over your dotfiles and configuration. |
| 46 | |
| 47 | For codespaces, see the documentation |
| 48 | [here](https://docs.github.com/en/codespaces/setting-your-user-preferences/personalizing-github-codespaces-for-your-account#dotfiles). |
| 49 | For dev containers, see the documentation [here](https://code.visualstudio.com/docs/devcontainers/containers#_personalizing-with-dotfile-repositories). |
| 50 | |
| 51 | You can use the same dotfiles repo for both, but note that codespaces has a few |
| 52 | more limitations outlined in their documentation. |
| 53 | |