Utilizing dev containers
When you’re utilizing dev containers as a part of your normal toolchain, you may create a library of options that may be rapidly added to your container definitions. You possibly can customise off-the-shelf containers or rapidly construct a brand new definition for a brand new mission, treating options as constructing blocks that sit on prime of a typical base container that’s been outlined for a particular stack.
The essential technique of constructing a dev container makes quite a lot of sense. It’s a top-down method, which wants to start out with architects and dev leads agreeing on a mission stack. You possibly can then discover a base platform picture, say .Web, within the VS Code container gallery. After you have that, you customise it on your mission, including new instruments by modifying the devcontainer.json
in VS Code and by including predefined options. As soon as the container is able to use, deploy it and the mandatory VS Code instruments to your improvement workforce.
Your native container host must be operating Docker or a minimum of have a Docker-compliant CLI on prime of its engine. The CLI is vital right here, because the dev container works by it slightly than needing direct entry to your container host. That’s each a profit and a disadvantage: There’s no dependency on APIs and even on Docker itself. So long as a container setting helps the Docker CLI, you need to use it together with your dev containers. Nevertheless, if it doesn’t, you may’t. Which means there are points with different container engines, akin to Podman, which solely help a subset of the Docker CLI. In fact, as dev containers is an open supply mission, there’s ongoing work to help different container engines, and you can also make requests or submit code by way of GitHub.