Check out example codes for "launch sql script from docker in mysql". It will help you in understanding the concepts better.

Code Example 1

docker exec <container_id> /bin/sh -c 'mysql -u root -ppassword </dummy.sql'

Learn ReactJs, React Native from akashmittal.com