Skip to content
BENIBIX Learn

Dev Container

Infrastructure📦 ContainersContainer Basics

Also known as Development Container, devcontainer.json, Devcontainer

A container set up as a place to code. Every coder gets the same tools.

Think of it like

It is like a desk that is set up for you. Your tools are laid out before you sit down.

Example

A new hire at Jack's company opens the project in VS Code. It builds the dev container for her, and she runs the tests on her first morning with nothing installed by hand.

Why it matters

Getting a laptop ready for a project can take a day. A dev container turns that into one step.

Definition

A dev container is a container set up for writing code, not for running the finished app. It holds the right language and tools for one project. The setup lives in one small file in the project. Your code editor opens the project inside the container. Everyone on the team gets the same tools, whatever computer they use.

Example code

json
{
  "name": "Shop app",
  "image": "mcr.microsoft.com/devcontainers/go:1"
}
The smallest dev container file. It names one ready-made image to write code inside.
A dev container is one of these slim boxes. It holds coding tools instead of a finished app.

Common mistake

Shipping the dev container as the live app. It is full of tools the live app does not need.

Key takeaways

  1. 1
    For writing code. It holds tools, not the finished app.
  2. 2
    Lives with the code. The setup file sits in the project.
  3. 3
    Same for everyone. Every laptop gets the same tools.