Working with Dev Containers

Chris Ayers

Chris Ayers

Senior Customer Engineer
Microsoft

Twitter: @Chris_L_Ayers
Mastodon: @Chrisayers@hachyderm.io
LinkedIn: - chris-l-ayers
Blog: https://chris-ayers.com/
GitHub: Codebytes

Agenda

  • Prerequisites
  • What are Dev Containers?
  • How Dev Containers Work?
  • Why use Dev Containers?
  • How to build a Dev Containers?

Prerequisites

  • VS Code
  • Docker
    • Windows - Docker Desktop 2.0+ / WSL2
    • Mac - Docker Desktop 2.0+
    • Linux - Docker CE/EE 18.06+ / Docker Compose 1.21+
      • (Ubuntu snap not supported)
  • VSCode - Dev Containers Extension

What are Dev Containers?

Dev Containers are:

  • Environments that run in a container
  • Containers that let you open or mount any folder and still use VS Code UI and tooling
  • Places to run Apps, Tools, or Runtimes needed for a project or codebase

How Dev Containers Work

Dev Containers

Why use Dev Containers?

  • Onboard new People
  • Use consistent tooling
  • Use consistent versions
  • Reduce System Conflicts
  • Perform Startup Tasks

How do you build a Dev Container?

From the Command Pallet

Add Dev Container files

Which Dev Container do I Pick?

Add Options

How Do I Configure it?

files

Templates

Full List: https://containers.dev/templates

  • Base (Alpine, Debian, Ubuntu)
  • Language Based (C#, C++, Java, Go, Node, Python, Rust, Ruby, PHP)
  • Tool Focused (Markdown, Kubernetes, Docker, Jekyll)

Features

Full list here: https://containers.dev/features

  • CLIs (azure, gh, gcp, aws)
  • Tools (Terraform, kubernetes...)
  • Runtimes (Node, Python, Go, Java, .NET, PHP, Ruby, Rust, C/C++, C#)

Customizations

  • Extensions
  • Settings
  • Startup Tasks
  • Networking

DEMO TIME

Resources