In the Spring of 2022 we started using Docker Desktop and Visual Studio Code with the Remote Containers extension as our development environment. If you are taking my class in the Spring of 2022 or later, these are the setup instructions for you.
This project uses Docker and Visual Studio Code with the Remote Containers extension to provide a consistent repeatable disposable development environment for all of the labs in this course.
You will need the following software installed:
- Docker Desktop
- Visual Studio Code
- Remote Containers extension from the Visual Studio Marketplace
All of these can be installed manually by clicking on the links above or you can use a package manager like Homebrew on Mac of Chocolatey on Windows.
You can read more about creating these environments in my article: Creating Reproducible Development Environments
To bring up the development environment you should clone this repo, change into the repo directory:
git clone https://github.com/nyu-devops/sample-accounts.git
cd sample-accounts
Open Visual Studio Code using the code .
command. VS Code will prompt you to reopen in a container and you should say yes. This will take a while as it builds the Docker image and creates a container from it to develop in.
code .
Note that there is a period .
after the code
command. This tells Visual Studio Code to open the editor and load the current folder of files.
Once the environment is loaded you should be placed at a bash
prompt in the /app
folder inside of the development container. This folder is mounted to the current working directory of your repository on your computer. This means that any file you edit while inside of the /app
folder in the container is actually being edited on your computer. You can then commit your changes to git
from either inside or outside of the container.
Using Visual Studio Code with Docker, simply existing Visual Studio Code will stop the docker containers. They will start up again the next time you need to develop as long as you don't manually delete them.