Feedback on My Bash Wrapper for Managing Docker Compose Projects

0
6
Asked By TechieTurtle42 On

I've been juggling multiple Docker Compose projects across various directories, and it's become quite tedious. To simplify this, I created a small Bash wrapper that allows me to manage these projects by name and execute `docker compose` commands from anywhere.

For instance, I can simply type commands like `dcompose media`, `dlogs website`, or `ddown backup`.

Here's what the script does:
* It automatically discovers Compose projects in commonly used base directories.
* It maintains a straightforward registry file for manually added project paths.
* It's entirely written in pure Bash.
* It works seamlessly over SSH and on servers.
* The error messages and output are designed to be readable in a terminal.

If you're interested in checking out the code, you can find it here: [GitHub Repo](https://github.com/kyanjeuring/dstack). I'd love to hear your feedback on it!

3 Answers

Answered By CleverCoder99 On

I think this is pretty neat! Just a heads up, though, you mentioned it's "pure Bash" but it uses `awk`, which isn't actually Bash. Also, the `curl | bash` lines can be risky—some people are really against that method for security reasons. Just something to keep in mind! 🤔

TechieTurtle42 -

Good point! I suppose I should’ve said it's "Bash-based." The `curl | bash` is more about convenience, but I totally get the security concerns. That's why I made manual installation an option.

Answered By FriendlyNerd07 On

This looks awesome! I actually have a similar problem managing different environments on the same server. Thanks for sharing it! It’s really helpful to see a solution like this in action.

TechieTurtle42 -

Glad you found it useful! That was exactly my motivation for creating it—managing unrelated environments in one place.

Answered By DockerDynamo On

Portainer has been a game changer for me when it comes to managing Docker stuff effectively. Have you tried it?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.