Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker][Advanced] Support parsing Docker run / Docker compose's service syntax for creating templates #1816

Open
andrebrait opened this issue Aug 7, 2024 · 2 comments

Comments

@andrebrait
Copy link

andrebrait commented Aug 7, 2024

Essentially, I'd like to be able to create (or even maintain/edit, maybe?) container templates using either the docker run command and/or the docker compose service syntax. That would to more easily create templates and edit them by hand rather than dealing with the UI.

Originally posted by @luzfcb in #1813 (comment)

I don't know if it's the same thing as you thought, but I like OpenWRT's luci-app-dockerman option:

It has an option called Resolve CLI
You click on it, paste the docker create or docker run command, and then submit it to the backend, the backend parses the command, and the page/form reloads with all fields filled

step1:

image

step2:

image

step3

All fields was filled and you are able to customize mode before creating the container

image

The most logic is implemented in Lua https://github.com/lisaac/luci-app-dockerman/blob/7292955a1b415bb60fa2e403bb3a437b4b7f7846/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/newcontainer.lua#L63C1-L363C4

@thezoggy
Copy link

just in case you were not aware, you can already do this by installing the docker-compose plugin and then just doing your compose yaml
https://docs.ibracorp.io/docker-compose/docker-compose-for-unraid

@andrebrait
Copy link
Author

just in case you were not aware, you can already do this by installing the docker-compose plugin and then just doing your compose yaml https://docs.ibracorp.io/docker-compose/docker-compose-for-unraid

I'm aware of it, but it's not the same as first party support and there are good things about unRAID Templates and I think the user experience could be improved by either supporting or being able to convert from and to such syntax.

I think integrating it directly into the WebUI could have a lot of benefits for both users as well as container template authors.

Example: more advanced features or more easily making changes, etc., less need of modifying the UI to support new changes to Docker (for example, the current version on 6.12 already supports multiple networks and whatnot, but the UI does not).

By supporting the syntax/contract/schema of Docker Compose directly, it should be possible to derive the GUI from it and need less manual changes in the long run.

Eventually, we could even have templates that encompass an entire software stack (think a nice way to present a Docker Compose file in the App center).

That's not doable as of now via any plugins, and won't be without some significant amount of work.

Of course, baby steps. The proposal here is to just support converting like it does with showing you the command for docker create

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants