I have script like below the "docker run" is started and it will open tty for executing its command according of docker file,it'll take around 5-6 hours to report an execution end sign,but meanwhile I need to let it do the job and move forward in shell script lines and get some pid and make condition with it. No my problem is that I can't execute "docker run" and then move from it to other lines of script. how can I do that without influencing "docker run" command.
docker run --name=something -it --rm \ --link=postgresql:postgresql \ --publish=80:80 \ --env='something_PORT=80' \ --env='NGINX_MAX_UPLOAD_SIZE=60m' \ --volume=/srv/docker/something:/home/something/data \ --volume=/srv/docker/something/rgloader:/home/something/rgloader \ something:3.3 \ app:backup:restore #30 sec pass till process starts to unpack tar file. sleep 30 #Get PID of tar extraction process PID=`ps au | grep "tar -xf" | head -n 1 | awk '{print $2}'` echo $PID echo "tar file extraction is completed" #wait until tar extraction process ends while [ -e /proc/$PID ] do echo $PID PID still running sleep 10 done
docker runin background?