Develbox
A tool to create project specific containers using Podman and Go.
Why this exists
After reading about JetPack's Devbox on HackerNews, I wanted to use it to prevent supply-chain attacks when installing packages from NPM or PyPi.
The issue was that Nix isn't available on Fedora Silverblue, as it currently doesn't comply with the FHS (Nix directory is located on /nix
, but /
is read-only on Silverblue) and has issues with SELinux. There are other ways to install it, like:
I could instead have used developments containers with VSCode now that I think about it.
So instead of choosing all of those good options, I decided to try make a script that does something similar to Devbox and Toolbox but worse just to learn Golang.
What does that mean?
Mainly, it means that the code quality here probably is not the best. There are a ton of things that should be improved or made more secure.
I would fix them but my current knowledge on coding, containers and linux isn't enough to make this a better product.
TL;DR: It's best to not use this in your projects, as it is made for personal use.
Getting Started
If you are okay with all that, you can install this script by doing the following. First we should visit the prerequisites.
Prerequisites
This project requires you to have installed
You can get them from your package manager usually with as go
and podman
.
Installing
You can get the project using go install
like this:
go install github.com/kadmuffin/develbox@latest
Usage
It's recommended that you add .develbox/home
to your.gitignore
file.
To create a new container we first have to create a new config file:
develbox create -c
You can now change the config file to use another image or add any packages you wish to be install when creating the container. To actually create the container just run:
develbox create
After that you can enter the container using:
develbox enter
And after you are done stop the container with:
develbox stop
Contributing
If you wish to contribute to this small repo, you are welcome to submit your pull request. Take into account that I'm a total noob at this, so explanations and patience are appreciated!
License
This project is under the Apache 2.0 License.
Acknowledgments
- Billie Thompson - Provided README Template -
PurpleBooth
- Jetpack's Devbox - Inspiration - Devbox
- Toolbox - Used as reference for some things (for example, how to load /dev) - Toolbox
- Martin Viereck - Helpful Wiki - x11docker
- And even more projects in CREDITS.