Use a Docker container as a development environment with Visual Studio Code
In this workshop, you will learn how to access, customize, and add software to development containers in Visual Studio Code so that you can collaborate with ease across machines and development environments.
Goal | Description |
---|---|
What will you learn | How to load and connect to a remote project, customize settings when working with a development container, and add software to the container environment. |
What you'll need | Visual Studio Code, Docker Desktop, and Git |
Duration | 1 hour |
Slides | Powerpoint |
🎥 Click this image to watch Ornella walk you through the workshop
- Overview of Containers and Docker
- Introduction to Git
- Use a Docker container as a development environment with Visual Studio Code
Say you're working on a hackathon project with your classmates using Python, and you want to make sure that your project is compatible across multiple machines. In this workshop, you will learn how you can use development containers to work on any project without having to set up or configure your machine first.
In this section, you'll do some setup to open a sample project written in Python, and install the Remote Containers extension for Visual Studio Code.
Next, you'll learn how to use the Remote - Containers extension in Visual Studio Code. You'll be able to understand how Docker and Visual Studio Code make it possible to have projects contained in their own preconfigured, containerized environments using the extension.
Now that you have the extension ready to go, you'll add a dev container and open the sample project in the container.
After setting up the dev container for the project, you'll learn how to customize and automate all the project setup using the devcontainer.json file.
So far, you've learned how to add a preconfigured dev container and customize it using the devcontainer.json file. Next, you'll learn how to add software beyond what's available in those preconfigured dev containers to further customize your experience. Apply what you learned by using a Dockerfile to add Node.js to your container.
- Remote - Containers tutorial
- Learn to create a development container
- Main Remote - Containers documentation
- How students can use dev containers
To test your knowledge, try creating your own development container filled with your favorite coding tools. Share it with a friend!
Be sure to give feedback about this workshop!