Post

Ultimate DevContainer Reference Guide

A comprehensive guide to DevContainer configurations best practices for developers

Ultimate DevContainer Reference Guide

Introduction

In this blog post, I’ll share my comprehensive DevContainer configurations that can supercharge your development workflow.

DevContainer Configurations

DevContainers provide a consistent, reproducible development environment across different machines. I’ve created four essential configurations:

1. Base DevContainer

1
2
3
4
5
6
7
8
9
10
11
12
{
    "name": "Base Development Container",
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {
            "installZsh": true,
            "configureZshAsDefaultShell": true,
            "installOhMyZsh": true,
            "upgradePackages": true
        }
    }
}

Key Features:

  • Ubuntu-based image
  • Zsh shell with Oh My Zsh
  • Automatic package upgrades

2. Terraform DevContainer

1
2
3
4
5
6
7
8
9
10
{
    "name": "Terraform Development Container",
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/devcontainers/features/terraform:1": {
            "version": "latest"
        },
        "ghcr.io/devcontainers/features/aws-cli:1": {}
    }
}

Ideal for:

  • Infrastructure as Code (IaC)
  • Cloud infrastructure management
  • AWS CLI integration

3. Python3 DevContainer

1
2
3
4
5
6
7
8
9
{
    "name": "Python 3 Development Container",
    "image": "mcr.microsoft.com/devcontainers/python:1-bullseye",
    "features": {
        "ghcr.io/devcontainers/features/python:1": {
            "installTools": true
        }
    }
}

Perfect for:

  • Data science
  • Web development
  • Scripting and automation

4. Node.js DevContainer

1
2
3
4
5
6
7
8
9
{
    "name": "Node.js Development Container",
    "image": "mcr.microsoft.com/devcontainers/javascript-node:1-bullseye",
    "features": {
        "ghcr.io/devcontainers/features/node:1": {
            "version": "lts"
        }
    }
}

Great for:

  • Web applications
  • Frontend development
  • Backend JavaScript projects

Conclusion

DevContainers and Markdown are powerful tools that can significantly improve your development workflow. Experiment, customize, and find what works best for you!

Resources

This post is licensed under CC BY 4.0 by the author.