Try running the mysql 5.7 image with the datadir flag and include the bash script in the CMD.
CMD ["--datadir=/data ; sh db_translations.sh"]
What ends up happening is that the container runs and creates a folder called data for mysql; sh db_translations.sh. Any idea why this is happening?
While many containers treat
bash/shasENTRYPOINTand this works, for mysql containers,>ENTRYPOINTAlready a script, it will only accept the providedCMDand will notre-evaluatein script form.See using
/docker-entrypoint-initdb.das the script location for each document - https://hub.docker.com/_/mysql, although you may need Reorganized scripts and environments.