Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 2.49 KB

vscode-docker.md

File metadata and controls

40 lines (24 loc) · 2.49 KB

Software Development Guide - Spring 2022

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.

Prerequisite Software Installation

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:

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

Bring up the development environment

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.

Shutdown development environment

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.