Devcontainer CLI cookbook
Devcontainer CLI cookbook
Installation
Available Dev Container Templates
Setting up new Python project
Create configuration directory
1
2
3
devcontainer templates apply \
--workspace-folder . \
--template-id ghcr.io/devcontainers/templates/python:3.1.0
Spinning up new devcontainer
1
devcontainer up
Specify certain container name
Add following line to the devcontainer.json file ↓
1
2
3
{
"runArgs": ["--name", "alpha"]
}
Add Dockerfile
Attach to running container
1
2
3
docker exec \
--interactive \
--tty alpha /bin/bash
This post is licensed under CC BY 4.0 by the author.