Development Containers
containers.dev › implementors › json_reference
Dev Container metadata reference
While most properties apply to any devcontainer.json supporting tool or service, a few are specific to certain tools. You may explore this in the supporting tools and services document. When creating or working with a dev container, you may need different commands to be run at different points in the container’s lifecycle. The table below lists a set of command properties you can use to update what the container’s contents in the order in which they are run (for example...
.devcontainer Containerized environment workflow
-1. Regarding tools/features, the official docs link is correct. https://code.visualstudio.com/docs/devcontainers/create-dev-container#_install-additional-software They should be in the 'customizations' section of the Dockerfile. That way, when you share your devcontainer (and Dockerfile), everything gets shared correctly. -2. When using multiple softwares (e.g. Deno, PostgreSQL), you can use a single container, or multiple. However, single containers with everything in them is ideal as it maintains consistency across the application stack. In the case of multiple containers, you'll need to share each of the 'devcontainer' setups as well. The one advantage I see here is that if I want to use a single PostgreSQL instance across multiple applications, this is better, since my backups etc. contain the data of all applications. However, this requires extra fiddling to get everything working across containers. Have a look at the Microsoft DevContainers Templates at their Github repository - https://github.com/devcontainers/templates You will see examples of single as well as multiple containers. -3. The setup with the 'devcontainers' directory ideally should contain everything for a another developer to have an identical environment as yours. The application code doesn't need to be shared. Hope all this helps. All the best. More on reddit.com
Issues with creating a Java Dev Container with Maven in VSCode on M1 Mac
I would urge you to just forget about doing development 'inside' a docker container. It's simply not what Docker is for and you're just constantly going to run into issues like these. Using Docker to (for example) spin up databases is fine though. You're much better off just installing Java locally. Prefferably via SDKMAN . Maven etc. can be installed via Homebrew. I have 2 M1 macs and they work fine for most Java development stuff. More on reddit.com
How to Creating Dev Container from docker image in private registry?
As u/pretzelfisch said, create a dockerfile that uses your internal image and add anything else you need. Devcontainers have 'features' - a bountiful set of resources, many linters. Another tip is, after installing any extensions, right click on it and "add it to devcontainer.json" Take the time to learn about devcontainers, they are invaluable - I do all my dev in them, multiple different golang / python / c++ environments, no pollution or cross-contamination. More on reddit.com
A working VSCode devcontainer for Nix/NixOS
Fwiw, there is already a devcontainer “feature” for the nix package manager: https://github.com/devcontainers/features/tree/main/src/nix More on reddit.com
Videos
19:45
you should be using dev containers - YouTube
30:25
Working with Dev Containers - YouTube
19:40
How to build your first Devcontainer - YouTube
06:59
Get Started with Dev Containers in VS Code - YouTube
01:05
How to change the user in a dev container - YouTube
Using devcontainer json file locally through Docker Desktop
DevPod
devpod.sh › devcontainer.json
devcontainer.json | DevPod docs | DevContainers everywhere
You can think of features as reusable Dockerfile parts that will be merged into your Dockerfile upon creation. This makes it easy to reuse functionality such as docker-in-docker or install extra tooling such as node or kubectl without having to look up the exact Dockerfile commands.
GitHub
github.com › devcontainers › features
GitHub - devcontainers/features: A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own · GitHub
Each Feature has a README.md that shows how to reference the Feature and which options are available for that Feature. The example below installs the go and docker-in-docker declared in the ./src directory ...
Starred by 1.4K users
Forked by 590 users
Languages Shell
Development Containers
containers.dev › implementors › json_schema
devcontainer.json schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "description": "Defines a dev container", "allowComments": true, "allowTrailingCommas": false, "definitions": { "devContainerCommon": { "type": "object", "properties": { "name": { "type": "string", "description": "A name for the dev container which can be displayed to the user." }, "features": { "type": "object", "description": "Features to add to the dev container.", "additionalProperties": true }, "overrideFeatureInstallOrder": { "type": "array", "description": "Array consisting of the Feature id (without the semantic version) of Features in the order the user wants them to be installed.", "items": { "type": "string" } }, "forwardPorts": { "type": "array", "description": "Ports that are forwarded from the container to the local machine.
GitHub
docs.github.com › en › codespaces › setting-up-your-project-for-codespaces › adding-a-dev-container-configuration › introduction-to-dev-containers
Introduction to dev containers - GitHub Docs
A new .devcontainer/devcontainer.json file will open in the editor. The file will contain some initial properties, including a features object to which you can add new tools, libraries, or runtimes.
Visual Studio Code
code.visualstudio.com › blogs › 2022 › 09 › 15 › dev-container-features
Custom Dev Container Features
September 15, 2022 - Referencing different Features from the devcontainers/features repository is as simple as adding a features property to your devcontainer.json. Each Feature has a README.md that shows how to reference the Feature and which options are available for it. The example below installs the go and ...
Bamurtaugh
bamurtaugh.github.io › dev-container-spec › implementors › json_reference
devcontainer.json reference
Today, devcontainer.json includes scenario specific properties for working without a container orchestrator (by directly referencing an image or Dockerfile) and for using Docker Compose as a simple multi-container orchestrator.
Development Containers
containers.dev › implementors › features
Dev Container Features reference
Feature metadata is captured by a devcontainer-feature.json file in the root folder of the feature. Note: While Features may be installed on top of any base image, the implementation of a Feature might restrict it to a subset of possible base images. For example, some Features may be authored to work with a certain Linux distro (e.g.
Aaron-powell
aaron-powell.com › posts › 2023-01-11-simplifying-devcontainers-with-features
Simplifying devcontainers With Features | LINQ to Fail
The repo that my blog lives in ... and a devcontainer.json file that describes how to use it within VS Code. Over time I’ve added some more to the RUN command in the Dockerfile that installed more default installs, and it just kind of did it’s thing. Today though, I decided to port it across to using Features, and you’ll ...
GitHub
github.com › devcontainers › feature-starter
GitHub - devcontainers/feature-starter: A bootstrap repo for self-authoring Dev Container Features · GitHub
The example in this repository follows the dev container Feature distribution specification. To provide feedback to the specification, please leave a comment on spec issue #70. For more broad feedback regarding dev container Features, please see spec issue #61. This repository contains a collection of two Features - hello and color. These Features serve as simple feature implementations. Each sub-section below shows a sample devcontainer.json alongside example usage of the Feature.
Starred by 419 users
Forked by 244 users
Languages Shell
GitHub
github.com › devcontainers › spec › blob › main › docs › specs › devcontainer-reference.md
spec/docs/specs/devcontainer-reference.md at main · devcontainers/spec
If no devcontainer.json is found, it is up to the implementing tool or service to determine what to do. This specification does not dictate this behavior. Validate that the metadata (for example devcontainer.json) contains all parameters required for the selected configuration type.
Author devcontainers