Welcome to my personal collection of Devcontainer configurations! This repository serves as a hub for the various devcontainer.json setups I've crafted for my own development projects.
I'm an amateur developer who who enjoys project based learning. I frequently switch between projects that use different languages and architectures and devcontainers help me keep my base setup clean and minimal. I use Bluefin Linux with Podman for my development projects.
Your entire toolchain, dependencies, and runtime are packed into a neat little box, which you can open when you need them and close when you don't. The toys never leave the box. They never mess with other toys in other boxes. Think workspaces but on steroids. They allow for a minimalist base configuration, with isolated, full-featured development environments for each project that only exist for that project.
- Quick Setup: Spin up a new project environment in minutes, ready to code. Its just as easy to adapt a development script that has a lot of the things you need to fit your purposes exactly.
- Consistency: They work like templates. You have a configure them to set up a consistent foundation that you can build on quite easily for other project that sort of need the same foundational components.
- Shareable. They are easily shareable so that contributors can easily replicate your setup. Not something I use, but it makes this github repo useful to others.
- Isolation: Keep your host machine clean by preventing global installations and dependency conflicts.
- Portability: Easily move your development environment between different machines.
These configurations are designed to be used with Visual Studio Code and its "Dev Containers" extension, along with a container runtime like Docker or Podman.
Here's a general guide to get started:
-
Visual Studio Code.
- I havent tried this in vscodium (on my to-do-list).
- haven't tested them in codespaces (not on my to-do list).
-
Install the Dev Containers extension in VS Code.
-
Install a container runtime:
- I use Podman on linux, but I expect these will work just fine on docker
-
Navigate to the specific configuration you want in this repository.
-
Copy the entire .devcontainer folder into the root of your own project.
- The devcontainer.json is the main file here - the .sh files are just useful scripts to initialise the repository, and create basic configs.
-
Open your project folder in VS Code.
-
VS Code should prompt you to "Reopen in Container". Click this button. If it doesn't, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and search for "Dev Containers: Reopen in Container".
- Keep an eye on the logs - things may go wrong here depending on your config. Gemini or Claude are fairly good at debugging until the point where they start listing obscure reasons for failure.
- Once that happens just google it - someone on a forum somewhere likely has a solution. Or drop the feature from the build process and just add it manually after. Trust me you'll waste less time.
Once the container is built and you're connected, you'll be working directly inside the containerized environment. From this point onwards its pretty standard. You can close VSCode or click file close remote connection to shut down the container.
For Podman make sure you perform the following:
-
Set podman as the default provider:
# Type the following into your operating system terminal systemctl --user enable podman.socket systemctl --user start podman.socket
-
Add the following to your VS Code settings - I do this at user level.
{ "dev.containers.dockerComposePath": "podman-compose", "dev.containers.dockerPath": "podman" } -
My configs can be quite complex, but if you encounter issues, strip away all the features, extensions and scripts and add them back one by one until you get something that works, then add things back one by one (rebuilding without cache each time).
-
Container Logs are your friend. Share your friend with Gemini.
-
Prune podman once your container is up and running.
# Type the following into your operating system terminal podman system prune --all
His guide helped me get past some issues on Bluefin with Podman that had me stumped for quite some time. I highly recommend reading his guide.
Everything related to devcontainers, from base images to templates, and sepecifications. Definitely check this out. Consider these the microsoft defaults, but open source.
The DevContainers Documentation
The devcontainer documentation - my configs really only scrape the surface.
Suggestions and improvements are always welcome! Feel free to open an issue if you have ideas for enhancing these configurations.
Final Note: While I'm happy to share these templates, my capacity for providing direct debugging support for your specific system or setup is limited due to my personal and professional commitments. I encourage you to consult the official Dev Containers documentation for general troubleshooting.