will-moss / isaiah

Self-hostable clone of lazydocker for the web. Manage your Docker fleet with ease
MIT License
855 stars 15 forks source link

[Feature Request] Edit Docker Container | Add Docker Compose ability #6

Open Vinylwalk3r opened 1 month ago

Vinylwalk3r commented 1 month ago

Okay, I think I have a rough idea here. First of disclaimer time I'm not UI designer at all. So I just throwing a rough and unpolished idea here. But lets hope it can inspire something great!

Add a way to edit a existing containers config (volumes, env variables, etc)

Extend "Run Image" functionality using Docker Compose / Run

Question of Isaiah and Compose support

I've been thinking, do you think Isaiah could handle compose codes? It would need to

  1. "mkdir new-compose-project" then
  2. "touch (or whatever command is necessary) docker-compose.yml "all the inputted compose code"
  3. then "docker compose up" Would that be possible, in whatever implementation you choose?

Final Notes

Do you think any of this could be doable / fitting for Isaiah? Again, these images are just to help visualize my ideas. The final product (of implemented) would be much more polished.

will-moss commented 1 month ago

Hi again!

Thanks a lot for taking the time to open that issue and for providing all those details and design ideas (and no need to be a designer! Your mockups are already very useful).

I have been thinking about that feature and everything you've described, and here's what I think :

All in all, unless you see limitations in my descriptions, I think I can start working on these features this week. The only "caveats / importants things not to take lightly" that I can see are :

Let me know if any idea / suggestion / limitation comes to your mind, and thanks a lot once again!

Looking forward to releasing that part !!

Vinylwalk3r commented 1 month ago

Glad they could be of help!

About the Container Edit feature

Some other note:

Good luck with coding it in and cant wait to try it out! Take your time, no hurry!

will-moss commented 3 weeks ago

Alright !

It's been a long time since our last conversation, and I'm glad to inform you that I have just published a new release.

As always, thank you a ton for helping, for providing details, and for asking questions.

I think this is the biggest release so far, and this is what it includes :

Regarding your questions :

Ultimately, regarding the "run image" feature, I have come to the conclusion that, given all the other features already implemented, adding an extra step to running an image may not be required or useful. I thought that, one could use the "Create stack" feature, or "Run image" then "Edit container" features. What do you think? Once again, I'm not opposed to it at all, I am just worried that I may repeat a lot of code when there are existing solutions.

Thank you very much again, and I hope this release works well for you!

PS : I still have to add a few security checks in a new version (to prevent someone from running anything other than "docker run" on their system).

Edit (19 august 2024) : A security check was added, along with documentation, and everything was released just now. After further testing, I'm confident that this feature is working, but I'll keep my eyes open until anyone confirms that it works for them as well.

CptanPanic commented 1 week ago

To go along with this, will it be possible in the future to have Isaiah create stacks, when it was started as a container?

will-moss commented 1 week ago

Thanks for joining this issue!

I will try to provide as many details as possible :

Another solution would be to go with a 3rd party project that creates a Docker Compose API or translates a docker-compose.yml file into Docker Engine API calls, and integrate it into Isaiah, or as an external service to deploy and call from Isaiah. I'm sure this is feasible, but I'm worried about the maintenance : Since it wouldn't be an official project, what will happen when the official Docker project is updated? Is there a strong community around it? is there a strong documentation with known issues and edge cases? Are we sure that the 3rd party APi is robust and supports 100% of Docker Compose features? etc.

To be frank, I'm not opposed to working on the aforementioned solution, especially if it makes everyone's life easier. I would just like to be 100% confident that 1) the project is solid and well-maintained, and 2) the risk / benefit ratio is worth for people hosting isaiah (example: in case of data loss or service interruption due to Isaiah + 3rd party, I would be losing my mind).

If you have any idea or guidance on that issue, I'll gladly take it as I'm myself dissatisfied with the current error pop-up.

CptanPanic commented 1 week ago

@will-moss I know portainer doesn't use regular docker-compose is this how they do it?

will-moss commented 1 week ago

I have tried to do my research (reading Portainer's source code and other projects) and I think that Portainer has implemented their own yml-to-API engine. They make a distinction between Portainer Stacks, and Docker Compose Stacks. When using native Docker Compose Stacks, indeed, nothing can be done (up, down, edit, pull, etc.), it's all disabled. However, when using Portainer stacks, everything's working again.

Here's a screenshot : https://ibb.co/F4rGP8y And another one : https://ibb.co/McC7Lv3

They explicitly mention : "This stack was created outside of Portainer. Control over this stack is limited.". Therefore I believe that, when using native Docker Compose Stacks, Portainer has the same limitations as Isaiah.

I have tried looking into their dependencies, source code, and even asking ChatGPT, and it really seems to me that they have implemented their own "Compose Layer" to handle it themselves. And searching for "Compose" in their issues reveals that, indeed, they have a few native features that are unsupported or causing bugs.

Being the only developer (so far) on the project, I think I don't have what it takes to undertake this development (add support for Docker Compose like Portainer did), unless I can reuse code from Portainer. Once again, I'm not against it, but I would feel more confident working on it as a team or using the robust development of a previous team before me.

Note : I have looked into libcompose, and it's deprecated. There's also compose-go, but it doesn't seem to support anything other than parsing files... Any other idea is always appreciated 🙏