luci icon indicating copy to clipboard operation
luci copied to clipboard

luci-app-dockerman: Add dockerd and docker-compose as dependency

Open tklengyel opened this issue 1 year ago • 15 comments

When installing luci-app-dockerman the webui appears empty and unusable if these dependencies are not installed (see https://forum.openwrt.org/t/luci-app-dockerman-missing-configuration-on-23-05-02/184043). Fix it by declaring them.

CC @lisaac

tklengyel avatar Mar 12 '24 20:03 tklengyel

Does luci-lib-docker also need dockerd and docker-compose as dependencies to work correctly? If that's the case it would probably make sense to add it to that Makefile instead since luci-app-dockerman depends on luci-lib-docker.

dannil avatar Mar 12 '24 20:03 dannil

Is openwrt updated to docker compose already, instead of the older docker-compose?

systemcrash avatar Mar 12 '24 20:03 systemcrash

Does luci-lib-docker also need dockerd and docker-compose as dependencies to work correctly? If that's the case it would probably make sense to add it to that Makefile instead since luci-app-dockerman depends on luci-lib-docker.

I don't think so, at least I can't see anything in luci-lib-docker to indicate that, it just seems to be a convenience library to provide access to the docker API.

tklengyel avatar Mar 12 '24 21:03 tklengyel

Is openwrt updated to docker compose already, instead of the older docker-compose?

Can you elaborate on what you mean? Is there a newer version of docker-compose with a different package name?

tklengyel avatar Mar 12 '24 21:03 tklengyel

Is openwrt updated to docker compose already, instead of the older docker-compose?

Can you elaborate on what you mean? Is there a newer version of docker-compose with a different package name?

https://github.com/docker/compose

systemcrash avatar Mar 12 '24 21:03 systemcrash

Is there a newer version of docker-compose with a different package name?

The docker compose v2 changed command to docker compose but the package name remains docker-compose.

The PR shouldn't be merged.

The dockerman is a client for the Docker that uses REST API. It doesn't call the docker command and does not depends on it. Technically speaking the Docker host can be on another computer.

You still can install dockerd and your router but you don't need the docker command and you can use the dockerman instead and save space.

Instead we may show a message for a user to clarify this and propose to execute opkg install dockerd.

Ideally before any changes we need to sync the dockerman with upstream version from https://github.com/lisaac/luci-app-dockerman. All changes needs to be copied and merged here and then it's author will fork it again but then send PRs to the repo https://github.com/lisaac/luci-app-dockerman/issues/157#issuecomment-1672239478

stokito avatar Mar 12 '24 22:03 stokito

Instead we may show a message for a user to clarify this and propose to execute opkg install dockerd.

See what I did in luci-app-910nd. There may be better ways of achieving it, but this works.

systemcrash avatar Mar 12 '24 22:03 systemcrash

Technically speaking the Docker host can be on another computer.

I think this would be a fairly niche setup. When I install luci-app-dockerman I expect to run dockerd on the router, especially when following the wiki OpenWrt as Docker container host

tklengyel avatar Mar 12 '24 23:03 tklengyel

From my point of view, if I install luci-app-dockerman, then dockerd should run on the router and thus be installed as a dependency. The application luci-app-dockerman is therefore only intended as a little helper for the LuCI. This means that luci-app-dockerman should make it possible to quickly run a container on the router and monitor it. I would not do a complex setup via the LuCI with luci-app-dockerman but via docker-compose via the cli. So nothing big. If you need a more professional configuration and status interface, then we should use other applications, for example https://www.portainer.io.

feckert avatar Mar 13 '24 07:03 feckert

especially when following the wiki OpenWrt as Docker container host

I fixed the Wiki, please review https://openwrt.org/docs/guide-user/virtualization/docker_host?do=diff&rev2%5B0%5D=1710248402&rev2%5B1%5D=1710318155&difftype=sidebyside

stokito avatar Mar 13 '24 08:03 stokito

Hi @tklengyel any refresh on this? @feckert any other opinions? I think this is acceptable as a new dep. If no changes, we can merge.

systemcrash avatar Apr 30 '24 13:04 systemcrash

The fix on the wiki was a good enough solution to me but if you think it's good to merge this PR anyway I think that's a more robust solution.

tklengyel avatar Apr 30 '24 14:04 tklengyel