It's not really feasible:
- The end user would have to have the Docker runtime installed, which isn't a normal external dependency for a desktop application;
- The setup to run GUI applications in Docker is complicated and very platform-dependent (on non-Linux you need extra host-side software);
- Running Docker containers requires administrator-level permissions, since you can use a bind mount to edit arbitrary files on the host, but desktop applications don't usually have that.
(In principle you could work around all of these things, but Docker is intended to run as a system daemon and isn't designed to be embedded in other applications.)
The most straightforward packaging approach for this would be to publish the images to Docker Hub or another publicly-accessible repository, and to publish the docker-compose.yml
file that launches the containers. Then an end user would need to install Docker, download the docker-compose.yml
file, run docker-compose up -d
, and point their browser to a specific URL to reach the front-end. That's less user-friendly than a standalone installer, but it is a small specific set of steps to run the application.
If you can restructure the application to use an embedded database like SQLite, and as a desktop application you don't need a federated login system, then you could also probably rebuild this whole thing as a native Electron application, without involving Docker at all.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…