A Bash script to dynamically generate Docker/Podman development containers based on predefined profiles and categories, with optional Zsh setup and a rootless developer user.
-
Supports Alpine and Debian base images.
-
Predefined profiles for common development stacks:
WebDev,Embedded,DataScience,RE,FullStack
-
Flexible categories:
C,Rust,Python,Node,Editors,Network,Debugging/RE,Database
-
Optional:
- Zsh + Oh My Zsh plugins (
autosuggestions,syntax-highlighting) - Rootless developer user with configurable UID
- Custom working directory
- Zsh + Oh My Zsh plugins (
-
Supports dry-run (print Dockerfile only) and build & run.
- Docker or Podman installed
- Bash 4+
- Internet connection for package installation and Oh My Zsh
Clone the repository from GitHub:
git clone https://github.com/rhjddjdbc/dcg.git
cd dcgMake the script executable:
chmod +x dcg.shThe script is now ready to use:
./dcg.sh --help./dcg.sh [options]| Option | Description |
|---|---|
--base <image> |
Base image (alpine:3.18, debian:12, debian:bookworm). Default: alpine:3.18 |
--profile <profile> |
Predefined profiles: WebDev, Embedded, DataScience, RE, FullStack. Can be repeated |
--categories "<list>" |
Additional categories, e.g., "C Python Node Database" |
--user <name> |
Developer username (default: devuser) |
--uid <uid> |
UID of the user (default: 1000) |
--workdir <path> |
Working directory in container (default: /workspace) |
--zsh |
Install Zsh + Oh My Zsh plugins |
--dry-run |
Print Dockerfile content only |
--build-run |
Build the image and start the container |
-h, --help |
Show help |
./dcg.sh --profile WebDev --zsh --dry-run./dcg.sh --profile FullStack --categories "C Python" --user devuser --uid 1000./dcg.sh --profile DataScience --build-run- A non-root user is created (
--user/--uid). - No
sudois required – fully rootless. - Zsh plugins are loaded automatically on container start.
| Profile | Categories |
|---|---|
| WebDev | Node, Python, Editors, Network, Database |
| Embedded | C, Rust, Editors, Network, Debugging/RE |
| DataScience | Python, Editors, Database |
| RE | Debugging/RE, C, Editors, Network |
| FullStack | Node, Python, Editors, Database, Network, C, Rust, Debugging/RE |
| Category | Tools |
|---|---|
| C | gcc, make, clang, build-base/build-essential, gdb, strace, ltrace, binutils, valgrind |
| Rust | rust, cargo, rustfmt, clippy, rust-analyzer |
| Python | python3, pip, ipython, jupyter, numpy, pandas, matplotlib |
| Node | nodejs, npm, yarn |
| Editors | nano, neovim |
| Network | curl, wget, netcat, tcpdump, nmap, git, ca-certificates |
| Debugging/RE | gdb, strace, ltrace, radare2, file, readelf, lsof, objdump, valgrind |
| Database | sqlite, postgresql-client, redis-tools |
- Switch base image carefully: package names differ (
apkvsapt-get). - Zsh plugins are installed automatically; no additional configuration needed.
- Rootless security: all files belong to the developer user.
MIT – free to use and modify.