For example, the host machine wants to use the container’s PHP -v command
docker exec -it <container name> php
However, the PHP cli in the container can only execute the script in the container. You can hang the host directory in when the container starts, so that you can throw the script into the host directory and use the container to execute PHP scripts.

Leave a Reply