Using Development Containers

Introduction

This documentation guides you through using Development Containers to create and manage consistent development environments across projects.

New to Development Containers? Start with our Setup Guide to get your environment configured.

Benefits

  • Start any project in seconds with a consistent environment

  • Work with identical tooling and settings across all projects

  • Eliminate "works on my machine" issues and enforces CI/CD parity

  • Reduce local machine resource usage through containerization

  • Focus on development instead of environment setup

Architecture Overview

Development Container Architecture

The development container uses a headless IDE architecture that separates concerns:

  • IDE backend runs in the container

  • Frontend UI runs locally via JetBrains Gateway

  • All development tools located within the container

  • Lower resource usage on local machine

Kubernetes Architecture

Our local k8s stack uses Kind (Kubernetes IN Docker):

Docker-in-Docker (DinD)
  • Provides isolated Docker environment

  • Enables reliable container builds

  • Maintains state between sessions

Kind
  • Runs Kubernetes nodes as containers inside DinD

  • Direct "containers all the way down" approach:

    • Devcontainer → DinD → Kind containers (running k8s)

  • More efficient than Minikube’s additional VM layer:

    • Devcontainer → DinD → Minikube VM → k8s containers

Base Image

The devcontainer-base:1.0 image includes:

  • Core Tools:

    • Java, Maven, & Git

    • Docker, KinD, Kubectl, Skaffold, Kustomize

The base image is maintained and updated regularly to ensure security and tool version consistency.

State Management

Volume Architecture

Our environment uses an efficient volume management system:

Infrastructure Volumes
DinD Volume (dind-${projectName})
  • Volume mount for Docker daemon state

    • Includes Kind cluster configuration

  • Can be safely reset without affecting development

    • docker volume remove dind-${projectName}

Development Volumes
Maven Repository
  • Bind mount from local .m2 directory

  • Prevents redundant downloads

  • Improves build times significantly

IDE Configuration (intellij-config)
  • Volume mount for IDE settings:

    • IDE preferences, Keymaps, Plugin configurations, Code style settings, Live templates

State Persistence Behavior

  • Volume contents persist between container restarts:

    • Development volumes (Maven, IDE settings) are shared across all projects

    • Infrastructure volume (Docker, k8s state) is unique per project

  • Volumes can be managed independently:

    • Development volumes maintain consistent experience

    • Infrastructure can be reset without affecting development setup

Advanced Configuration

Following Development Containers Specification you can make changes to configurations including, but not limited to:

Resource Allocation
  • Container memory limits

  • CPU allocation

  • Disk space management

Network Configuration
  • Port forwarding

  • Host network access

  • Container networking

Operation and Maintenance

Maintenance Tasks

Regular Maintenance
  • Volume cleanup strategies

  • Container image updates

  • Configuration backups

Troubleshooting Guide

Common Issues

Kubernetes Issues
  • Symptom: kubectl cannot find cluster

    • Try reconfiguring kubectl:

kind export kubeconfig
kubectl config use-context kind-kind
  • If issues persist, reset infrastructure volume:

docker volume remove dind-${projectName}

TODO’s & Enhancements

  • Cover git operations

  • Detailed guide for using iTerm (terminal access) to run commands against Devcontainer service

  • Move containerEnv to .zsh_devcontainer mount (update credentials doc)

  • Better guide/explanation of using forwardPorts

  • Postman host connection to container

  • Explanation of KinD

  • Volume and container management 'policies' or best practices

  • Dev vs Infrastructure volume explanation