DevDock: Easy Management for Development Containers

Search for a command to run...

It reminds me of Laravel Sail in some aspects, particularly with its use of development containers, although Laravel Sail is specifically designed for Visual Studio Code.
Visual Studio Code already have devcontainer but I find it a headache so I try to not use that. But thank you to introduce Laravel Sail. Is it a continuing project or deprecated?
Over the years, my journey through the innovation landscape has been nothing short of exhilarating. From working in cutting-edge innovation labs to collaborating closely with venture capitalists, venture builders, and factories, I’ve seen the power o...

After years of taking over the maintenance of pychartjs, I'm excited to finally have the time to bring some much-needed updates to the project. It's been a journey, but I'm proud to say that pychartjs is now framework-agnostic and fully compatible wi...

Introduction Recently, I worked on a project that needed many gRPC functions. If you've used gRPC, you know it helps different software programs talk to each other efficiently. However, making Proto files for every Python dataclass was taking a lot o...

I wanted to share some thoughts on the importance of code reviews, appreciating your teammates, and this cool tool I found called Git Add Co-Author that makes giving credit where it’s due super easy. A few weeks ago, I wrote a blog post titled "Contr...

Hello everyone, I hope you are doing well. I want to share some important news with you. I am nominating myself for the position of Director on the Board of the Python Software Foundation (PSF). My Statement Here is my official statement for the PSF ...

I want to share a little adventure I’ve been on - creating a tool called DevDock. But first, let me tell you why I started this project and how it makes life easier for developers like you and me.
In our small tech team, we often used Docker images and containers to streamline our development process. However, each time we started a new project or needed to make some tweaks, it was a hassle. We spent a lot of time modifying Docker Compose files or running containers with specific settings. It felt like a never-ending cycle of repetitive tasks, and it was frustrating.
One day, while working late on a project, I was stuck in a loop of updating Docker Compose files and rerunning containers. I thought, "There has to be a better way to do this." That’s when the light bulb went off. What if we could have a tool that made managing these environments as easy as snapping your fingers? A tool that could handle all these tweaks and configurations effortlessly. And that’s how the idea of DevDock was born – a tool to put these tasks right at our fingertips.
Think of a dev container as a magic box. You put all your tools, libraries, and dependencies in it, and it keeps them safe and sound. When you open the box, everything is ready to use. It’s like having a personal chef who knows exactly how you like your meals.
But why should we use dev containers? Let me tell you:
Consistency: No more “It works on my machine!” Everyone on the team has the same setup.
Portability: Move your project to any computer, and it will work the same.
Efficiency: Saves time and reduces frustration.
As we began using dev containers, another realization struck me: having dev containers wasn’t enough. We needed a way to save our ideal setups so that we could recreate them effortlessly. Imagine if you could take a snapshot of your perfectly organized kitchen and set it up exactly the same way anywhere you go. That’s what storing configurations does for dev containers. It keeps your settings, dependencies, and tools saved, ensuring you can set up your development environment quickly and consistently every time.
With this realization, I started working on DevDock. My goal was simple: make it easy to create, manage, and store configurations for development containers. Unlike some IDE-specific solutions like what Visual Studio Code offers, I wanted DevDock to be IDE-independent. This way, developers using any code editor or IDE could benefit from a smooth, consistent development environment. I spent days coding, testing, and fixing bugs. There were challenging moments, but I kept going, motivated by the thought of making life easier for my fellow developers.
Create Containers: Easily create containers with all the tools and dependencies you need.
Store Configurations: DevDock stores your configurations in a simple YAML file. This means you can recreate your environment anytime, anywhere.
Manage Volumes: Need to save data inside your container? No problem! DevDock helps you manage volumes too.
Support for Docker Compose: If you have a complex setup with multiple services, DevDock supports Docker Compose, making it easy to manage.
IDE Independence: Unlike VS Code’s built-in dev containers, DevDock works with any IDE or code editor.
Using DevDock is super simple. Here’s how you can start your own journey with DevDock:
Install DevDock:
pip install devdock
Create a Container from an Image:
devdock mkdevcontainer --image python:3.9 --name my-python-container --volumes /host/path1:/container/path1,/host/path2:/container/path2
Imagine you need a Python environment for a new project. With DevDock, you can create a container with Python 3.9 and map your local directories to the container effortlessly.
Run Services from a Docker Compose File:
devdock mkdevcontainer -f docker-compose.yaml --name my-compose --volume-mappings web:/host/path1:/var/www,web:/host/path2:/var/log/nginx,redis:/host/redis1:/data,db:/host/db1:/var/lib/postgresql/data
Suppose you have a web project that also needs Redis and a PostgreSQL database. Using DevDock, you can specify your Docker Compose file and add volume mappings for each service, making the setup process a breeze.
Activate a Configuration:
devdock workon my-compose
Once your environment is set up, you can activate it with a single command. DevDock will start all the services defined in your configuration, so you can get to work immediately.
Activate Specific Services:
devdock workon my-compose --services web
If you only need to work on the web service, DevDock can activate just that service along with its dependencies, saving you resources and startup time.
Run a Command Inside a Specific Service:
devdock run my-compose --service web "echo Hello, World!"
Need to run a command inside the web service? DevDock makes it simple. Just specify the service and the command, and DevDock takes care of the rest.
Enter Shell Inside a Specific Service:
devdock shell my-compose --service web
For more interactive work, you can enter a shell inside any service. This is great for debugging or making quick changes.
Remove a Configuration:
devdock rmdev my-compose
When you're done with a project, you can clean up easily. DevDock removes all the containers and configurations associated with your project, keeping your system tidy.
Creating DevDock has been an incredible journey. It started with a simple idea and grew into a tool that can help developers everywhere. Now, with DevDock, you can manage your dev containers with ease, save your configurations, and never worry about setting up your environment again.
If you’re a developer looking for a smoother workflow, give DevDock a try. I promise, it will make your coding life a lot easier. And who knows, you might just fall in love with it as much as I did.
I would love your feedback and contributions. If you have any ideas, suggestions, or find any issues, please visit our GitHub repository. Your contributions will help make DevDock even better.
GitHub Repository: DevDock GitHub Repository
If you have any questions or need help, feel free to reach out. I’m always happy to help fellow developers.