We ran a small lab for a guide on dev containers: six tiny projects, 13 tests, all through the Dev Container CLI with no editor attached. Every test asserts its result, so the script stops when something differs.
Three results were worth writing down.
1. forwardPorts did nothing without an editor
With the CLI alone, a project that asked for forwardPorts had no published port at all.
docker port output: []
Enter fullscreen mode
Exit fullscreen mode
A second project used appPort and Docker showed the port, bound to the local address.
docker port output: [8000/tcp -> 127.0.0.1:8000]
Enter fullscreen mode
Exit fullscreen mode
The specification recommends forwardPorts in most cases, and VS Code applies it once it connects. Our finding is narrower: in a CLI-only setup, nothing connects, so nothing is forwarded. We did not test how VS Code forwards ports.
2. Only two lifecycle commands run on a second start
Each lifecycle command appended its own name to a file.…