{"action":"created","issue":{"url":"https://api.github.com/repos/docker-library/mysql/issues/40","labels_url":"https://api.github.com/repos/docker-library/mysql/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/mysql/issues/40/comments","events_url":"https://api.github.com/repos/docker-library/mysql/issues/40/events","html_url":"https://github.com/docker-library/mysql/issues/40","id":54049468,"number":40,"title":"How to Populate database at container creation","user":{"login":"sdetweil","id":1498142,"avatar_url":"https://avatars.githubusercontent.com/u/1498142?v=3","gravatar_id":"","url":"https://api.github.com/users/sdetweil","html_url":"https://github.com/sdetweil","followers_url":"https://api.github.com/users/sdetweil/followers","following_url":"https://api.github.com/users/sdetweil/following{/other_user}","gists_url":"https://api.github.com/users/sdetweil/gists{/gist_id}","starred_url":"https://api.github.com/users/sdetweil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdetweil/subscriptions","organizations_url":"https://api.github.com/users/sdetweil/orgs","repos_url":"https://api.github.com/users/sdetweil/repos","events_url":"https://api.github.com/users/sdetweil/events{/privacy}","received_events_url":"https://api.github.com/users/sdetweil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-12T12:44:15Z","updated_at":"2015-01-18T17:29:53Z","closed_at":null,"body":"I have the container running, all the MYSQL_ parameters worked, the database was created and the user was defined and granted access to the database.. running in daemon mode\r\n\r\nthe database is empty as expected\r\nI want to execute the sql file that contains all the DB schema commands (create table, ....)\r\n\r\nI can create a script and run docker exec mysql, \r\nIF I did -v to map some host volume into the container when I started it\r\n\r\nis this the proper way? \r\n\r\nin my script, how do I wait til the daemon container is up and running?\r\ntry docker exec repeatedly til it works? (shouldn't work til the container CMD is running)\r\n\r\nI have also created my own image which does all the same things this does and adds support for database population, but it makes no sense to manage my own image."},"comment":{"url":"https://api.github.com/repos/docker-library/mysql/issues/comments/70416969","html_url":"https://github.com/docker-library/mysql/issues/40#issuecomment-70416969","issue_url":"https://api.github.com/repos/docker-library/mysql/issues/40","id":70416969,"user":{"login":"psychemedia","id":82988,"avatar_url":"https://avatars.githubusercontent.com/u/82988?v=3","gravatar_id":"","url":"https://api.github.com/users/psychemedia","html_url":"https://github.com/psychemedia","followers_url":"https://api.github.com/users/psychemedia/followers","following_url":"https://api.github.com/users/psychemedia/following{/other_user}","gists_url":"https://api.github.com/users/psychemedia/gists{/gist_id}","starred_url":"https://api.github.com/users/psychemedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychemedia/subscriptions","organizations_url":"https://api.github.com/users/psychemedia/orgs","repos_url":"https://api.github.com/users/psychemedia/repos","events_url":"https://api.github.com/users/psychemedia/events{/privacy}","received_events_url":"https://api.github.com/users/psychemedia/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T17:29:53Z","updated_at":"2015-01-18T17:29:53Z","body":"To further clarify: is there a way of starting the mysql container so that the the data is mounted *within* the mysql database server, such that it can be populated with data and then the container exported such that it contains the data?"}}