I recently faced one non-trivial (for me) case. Maybe you know any way to solve it.
I have a shell script that runs Docker command to start the Ubuntu container, which ends up with running guest Bash that starts some system services, including a web server. After guest Bash is initialised I want to open web browser on my host machine. Currently it looks like that:
docker run -it -p $PORT:80 -v $ROOT:/usr/share/nginx $PROJECT
python -m webbrowser http://localhost:$PORT
But that obviously doesn't work well, as script waits until
docker exits to start
python. Swapping them won't work as well, as website will be loaded before the guest Bash (and web server) is started. At the same time I need to run Docker with
docker ... & python ... won't work as well.
Is there any way to make things working?