Check out example codes for "docker run mysql volume". It will help you in understanding the concepts better.

Code Example 1

docker run \
--detach \
--name=[container_name]\
--env="MYSQL_ROOT_PASSWORD=[my_password]" \
--publish 6603:3306 \
--volume=/root/docker/[container_name]/conf.d:/etc/mysql/conf.d \
mysql

Learn ReactJs, React Native from akashmittal.com