tanzu-factory / tap-jumpstart

MIT License
4 stars 0 forks source link

Launch browser once the docker container has launched #20

Closed davidk355 closed 1 year ago

davidk355 commented 1 year ago

If we add this code to the start.sh then we can launch the browser for the appropriately running docker container

function openBrowser() 
{
    local foundImage=''
    while [[ -z $foundImage ]]; do
        foundImage=$(docker ps --filter "name=$1" --format '{{ .Names }}')
        if [[ -n $foundImage ]]; then
            open -n "http://$2:$3"
        fi
        sleep 2
    done
}

  # This is to spawn the browser based on the running container
  openBrowser $name $hostip $port &
alinahid477 commented 1 year ago

added to release 2.21092023