Is it possible to develop with Dev Containers having only VS Code and Docker Desktop installed on the host OS?
I would like to avoid installing git for Windows and keep the source code on the host OS, because I don’t want to get into the trouble of mismatched line endings and file ownership.
Currently I resolve the problem by developing inside WSL, but it comes with a price of maintaining a full-blown Ubuntu with package updates, dist-updates, etc. And it’s all in a non-devops manner.
I wonder if Dev Containers would allow me to avoid having git for Windows and git inside WSL: just start a minimalistic Dev Container, it already has git inside, and go.
When I think about it, it seems to be a chicken-and-egg problem: to start a Dev Container, I need devcontainer.json
and maybe Dockerfile
. In order to get them, I need to clone a repo that contains them. But I want to do it inside a Container, but I don’t have one yet…
I’ve noticed that VS Code lets me start a new blank container from a Docker image such as alpine
that has git
. And VS Code has a feature of connecting Dev Containers.
So can I start a dev container, get an SSH key to GitHub, clone a repo that contains devcontainer.json
into the container, then start another container in parallel from that devontainer.json
?
Or something else in that fashion… The goal is develop in Dev Containers and avoid using git
on the host OS or WSL.
Please provide step-by-step instructions including specific VS Code command pallete commands and configs.
Thanks! I hope my question makes sense. I want to DRY my dev env!