Press enter to see results or esc to cancel.

[note] PHP exec Docker run

For example: use this docker container to convert pdf file to html


PHP use shell_exec function to exec docker run, there is some notes:

  • Assign a container name with the --name option
  • Automatically clean up the container and remove the file system when the container exits, you can add the --rm flag
  • The input device is not a TTY. Remove the -it from your cli to make it non interactive and remove the TTY. If you don’t need either, e.g. running your command inside of a Jenkins or cron script, you should do this.
  • Add user apache to docker group


cmd in PHP:





1 Comment


The solution is very simple and good. I tried it. The programme goes.
Thank you

Leave a Comment