batch file - How to run Docker from php? -
i beginner in using docker, , trying run docker php, need run openface code. used command lines provided here https://cmusatyalab.github.io/openface/setup/ make sure docker running on pc correclty , works. need call php, wrote same commands in batch file follows
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash cd /root/openface ./demos/compare.py images/examples/{lennon*,clapton*} pause
and tried execute in php calling
echo shell_exec ("test.bat");
but when run batch file directly, first line executed. seems next command not being executed inside docker container.
how can make commands execute? appreciated, thank you
the problem first bash won't exit before exit , rest of commands interpreted host bash.
what need work done , inside bash (inside container)
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash -c "cd /root/openface && ./demos/compare.py images/examples/{lennon*,clapton*} && exec bash"
first "bash -c" execute commands , last command exec bash
override main bash , gives shell
Comments
Post a Comment