jlesage / docker-baseimage-gui

A minimal docker baseimage to ease creation of X graphical application containers
MIT License
1.2k stars 179 forks source link

Command line app #99

Closed darsor closed 1 year ago

darsor commented 1 year ago

For my application, I have several command line targets with different behaviors. For example:

/appdir/app1 /appdir/app2

Both of which take various command line arguments. In the past I've built the apps in a docker container, then configured X11 forwarding through the container. I'd like to use this GUI baseimage instead, but I'm having a hard time seeing how to execute the apps with arguments as a docker CMD instead of through a fixed startapp.sh script.

The S6 init system allows the user to execute a command-line application (e.g. /init ), which it manages. When the command exits, the init system shuts down. Is there a way to replicate this functionality with the new cinit system?

jlesage commented 1 year ago

If I understand correctly, you want the full container initialization to occurs, but at the end, you want your command to execute instead of startapp.sh ?

darsor commented 1 year ago

Yes, that's essentially correct. I assume the full container initialization is required in order for the GUI parts of the container to function properly.

jlesage commented 1 year ago

Currently the init system is not designed to perform a such thing. The application itself is started as a normal service.

Can you use environment variables to control what to do on startup ?