The official mysql image stores its data in a volume.
If you do want a database to populate on first run, then the mysql image does have a mechanism to make that happen:
FROM mysql:5.7.9
ADD sample.sql /docker-entrypoint-initdb.d/sample.sql
And then build it with: docker build -t tenzan/mysql:20151210
When the mysql image starts up, its entrypoint script will load anything it sees in the /docker-entrypoint-initdb.d/ directory.
Additionally, when you docker tag <image-id> tenzan/mysql-container:20151210, that creates another name for the exact same image id that you specify. Images are immutable, and you have to create new image layers (using a Dockerfile and docker build, or using docker commit).
This is expected behavior: the files inside the /docker-entrypoint-initdb.d/ are simply sourced, and will only create a database if they include the SQL statements to do so. The entrypoint script doesn’t implement any sort of magic to try to figure out which commands to issue to create a database for you.
You could indeed set an environment variable in the Dockerfile-- just do something like: