- Getting started with development containers
- Install the Prerequisite Software
- Setting up Docker Desktop for Windows with WSL 2
- Install Azure CLI on WSL
- Configure Local Development Environment
The Visual Studio Code Dev Containers extension lets you use a container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set. A devcontainer.json file in your project tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack. This container can be used to run an application or to separate tools, libraries, or runtime needed for working with a codebase.
More information can be found at Developing inside a Container.
Install the following software on the machine you will perform the deployment from:
- Windows Store Ubuntu 22.04 LTS
- Docker Desktop
- Visual Studio Code
- Remote-Containers VS Code Extension
- Git for Windows
Docker Desktop for Windows provides a development environment for building, shipping, and running dockerized apps. By enabling the WSL 2 based engine, you can run both Linux and Windows containers in Docker Desktop on the same machine.
To enable Developing inside a Container you must configure the integration between Docker Desktop and Ubuntu on your machine.
- Launch Docker Desktop
- Open Settings > General. Make sure the *Use the WSL 2 based engine" is enabled.
- Navigate to Settings > Resources > WSL INTEGRATION.
- Ensure *Enable Integration with my default WSL distro" is enabled.
- Enable the Ubuntu-22.04 option.
- Select Apply & Restart
Now that Docker Desktop and Ubuntu are integrated, we want to Access the Ubuntu bash prompt from inside VSCode.
Once this is complete, you are ready to configure Git for your Ubuntu WSL environment.
The next step is to configure Git for your Ubuntu WSL environment. We will use the bash prompt from the previous step to issue the following commands:
Set Git User Name and Email
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Set Git UseHttps
git config --global credential.useHttpPath true
Configure Git to use the Windows Host Credential Manager
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe"
In your Ubuntu 22.04(WSL) terminal from the previous step, follow the directions here to install Azure CLI.
Follow these steps to get the accelerator up and running in a subscription of your choice.
The first step will be to clone the Git repo into your Ubuntu 18.04 WSL environment and, for production deployments, checkout the version that you would like to deploy. For development, stay on main and checkout an appropriate branch. To do this:
- In GitHub, on the Source Tab select <> Code and get the HTTPS Clone path.
- Launch VSCode. Open the Ubuntu 22.04(WSL) Terminal.
- Run the following command from the bash command prompt
git clone <repo url> info-assist cd info-assist git fetch --tags git checkout tags/<version>
This will now have created the info-assist folder on your Ubuntu 22.04 WSL environment.
The next step is to open the source code and build the dev container. To do this you will:
- Log into Azure using the Azure CLI
- Open the cloned source code into VSCode
- Launch and connect to the development container from VSCode
When using any new version of Info Assistant code base from the repo, be sure to rebuild your development container.
A new popup should appear in VS Code to rebuild the container. If the popup does not appear you can also do the following:
- Control + Shift + P
- Type Rebuild and select "Dev Containers: Rebuild Container"
This step is complete, please continue on to the next step Configuring your Development Environment for PS Info Assistant section and complete the next step.