Non-members of medium can read here
❓ What’s a devcontainer
A devcontainer is a feature that lets you run docker containers locally for development. This brings a lot of advantages! I listed a few here:
- Useful for bigger groups
- Doesn’t matter what operating system, version or compatability your local device has. (It’s built for that purpose!)
- Fast and secure
🏗 Create your own devcontainer
FYI: For this part some docker knowledge is required and is not getting teached.
Now in this example let’s create a simple and small NodeJS devcontainer
We start with creating a .devcontainer
folder in the root directory of our project.
All we need more for our devcontainer are two more files. The devcontainer.json
for configs and a default Dockerfile
. devcontainer.json
{
"name": "YourProjectName",
"build": {
"dockerfile": "Dockerfile"
},
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
"path"…