![]() ![]()
Whilst it is currently early days for the WSL/dev containers integration, I’m excited to see it coming. When originally written, the steps in this post used a lot of preview features but now they are all generally available and I realise that this might not be for everyone! Summary The left side of the status bar has a handy indicator that you are running in a dev container VS Code will start building the dev container and once that is done you will have the folder loaded in a dev container with the source from WSL :-) Click this to reopen the folder in a dev container. ![]() (If you don’t get the prompt then select “Remote-Containers: Reopen in Container” in the command palette). Once VS Code has loaded the workspace and extensions you should get a toast notification prompting you to reopen the folder as a dev container. To load this in VS Code and be able to work on it in a dev container we can load the code from the bash prompt via code. ![]() Run bash (e.g Win+R and bash), navigate to a folder where you want to clone the source code and run git clone. There are a number of sample projects listed here such as. Now that everything is installed, let’s clone a sample project to give it a spin. If you prefer to control your settings in JSON then the setting to add is "": true Giving it a spin In the settings search bar type experimental WSL and tick the box to enable the option. In the command palette ( Ctrl + Shift + P by default) type user settings and hit Enter to load the user settings. Get Visual Studio Code here and then make sure you have the Remote Extension Pack extension installed.įinally, the WSL integration is currently in experimental mode so it isn’t enabled by default. Next we need Visual Studio Code and the Remote Containers extension. #WSL VISUAL STUDIO CODE INSTALL WINDOWS#Docker for Windows used to starts up a Linux VM to run the Docker daemon in, but there is now support for running the daemon in WSL2 - open settings and ensure that the WSL integration is turned on and enabled for any WSL distributions that you want to run your dev containers in. #WSL VISUAL STUDIO CODE INSTALL INSTALL#To run containers on Windows you would normally install Docker for Windows. This is currently only available via the Windows Insider program - see the docs for WSL 2 installation instructions. To get all of this working you need to have WSL 2. In this post I’ll walk through the various components that need to be configured to enable this. This is something that I’ve wanted to be able to do for a while and after some discussions with the Remote-Containers team (thanks Christof and Chuck!) they merged in a PR I opened that gives a starting point for this capability. While this has still been a great experience overall, I have hit a few edge cases where being able to have my source code in Linux (under WSL) and then create a dev container from there would have been a big help. Until very recently your source code needed to be cloned in Windows in order to be able to build and run dev containers with Visual Studio Code. In my previous post I gave some thoughts on using Visual Studio Code dev containers. I have updated the post to reflect this (update made in vscode dev container on stable release □). #WSL VISUAL STUDIO CODE INSTALL UPDATE#UPDATE (): With the 1.44 release of Visual Studio Code (and the corresponding Remote Containers release), the Insiders release is no longer needed as the. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |