Closed darsor closed 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
?
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.
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 ?
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?