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

[QUESTION] - Catch background process #96

Closed gantispam closed 1 year ago

gantispam commented 1 year ago

Hi,

thx for this awesome container!

Question : how "catch" background process on startapp.sh?

Context : I try to build à container for run jetbrain fleet solution (https://www.jetbrains.com/fr-fr/fleet/) but GUI seen to be start on background, so http://[HOST IP ADDR]:5800 return a black screen..

Fewer words and more examples :

services:

fleet-ide: build: ./ container_name: fleet-ide ports:

ENV WORKSPACE=/opt/workspace ENV PROJECT=${WORKSPACE}/project

Install env. dep

RUN apk add curl

Install Fleet

RUN mkdir ${WORKSPACE} && mkdir ${PROJECT} && chmod 777 ${PROJECT} && cd ${WORKSPACE} \ && curl -LSs "https://download.jetbrains.com/product?code=FLL&release.type=preview&release.type=eap&platform=linux_x64" --output fleet && chmod +x fleet

Copy the start script.

COPY startapp.sh /startapp.sh

Set the name of the application.

RUN set-cont-env APP_NAME "FleetIDE"

* startapp.sh
```bash
#!/bin/sh

cd ${WORKSPACE}

# WORKSTATION
# exec ./fleet launch workspace -- --auth=accept-everyone --publish --enableSmartMode --projectDir=${PROJECT}

# LOCAL GUI ==> that was the problem
# without "tail -f /dev/null" : produce exit container (finished)
# with "tail -f /dev/null" : produce black screen, we need to redirect on GUI pid ?
exec ./fleet ${PROJECT} && echo "STARTED" && tail -f /dev/null
jlesage commented 1 year ago

It seems to me that the application doesn't show a UI at all.

Did you try to manually starts the application to see what is happening ? You can add a sleep infinity to the beginning of startapp.sh. This allows you to enter the container's shell (docker exec -ti <container name> sh) and from there you can try to start the app yourself.

gantispam commented 1 year ago

thx for your answer. I think you are rigth, fleet ide seen to work only on remote state.. thx