{"id":18487706,"url":"https://github.com/lindycoder/prepopulated-mysql-container-example","last_synced_at":"2025-04-08T20:31:45.694Z","repository":{"id":70208072,"uuid":"136666138","full_name":"lindycoder/prepopulated-mysql-container-example","owner":"lindycoder","description":"This is an example on how to make a prepopulated container image.","archived":false,"fork":false,"pushed_at":"2024-12-06T14:35:27.000Z","size":2,"stargazers_count":71,"open_issues_count":1,"forks_count":42,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T15:32:20.909Z","etag":null,"topics":["container","docker","mariadb","mysql"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lindycoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-08T21:07:34.000Z","updated_at":"2024-12-06T14:35:31.000Z","dependencies_parsed_at":"2024-11-06T12:56:05.009Z","dependency_job_id":"6cf05531-fa10-4d64-a33f-41ab9661fe90","html_url":"https://github.com/lindycoder/prepopulated-mysql-container-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindycoder%2Fprepopulated-mysql-container-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindycoder%2Fprepopulated-mysql-container-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindycoder%2Fprepopulated-mysql-container-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lindycoder%2Fprepopulated-mysql-container-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lindycoder","download_url":"https://codeload.github.com/lindycoder/prepopulated-mysql-container-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247923079,"owners_count":21018923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","docker","mariadb","mysql"],"created_at":"2024-11-06T12:50:44.318Z","updated_at":"2025-04-08T20:31:45.689Z","avatar_url":"https://github.com/lindycoder.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"A prepopulated mysql container ?\n================================\n\nYeah why not, i like my test faster :D\n\nBut how ?\n---------\n\nThe mysql/mariadb container image contain an init script that will execute everything in `/docker-entrypoint-initdb.d/`\n\nsee `Initializing a fresh instance` @ https://hub.docker.com/_/mariadb/\n\nSo let's run this initialization in a multi-stage build and copy the initialized DB in the new image :D\n\n(see comments in dockerfile for details of the hack) \n\nTry it!\n======\n\nClone this, then...\n\n```\n}\u003e docker build --tag my-prepopulated-image .\n...\n\n}\u003e docker run -d --rm --name my-container my-prepopulated-image\n...\n\n}\u003e docker logs my-container\n\n(there was is initialization here, therefore we win)\n\n2018-06-08 21:15:55 0 [Note] mysqld (mysqld 10.3.7-MariaDB-1:10.3.7+maria~jessie) starting as process 1 ...\n2018-06-08 21:15:55 0 [Note] InnoDB: Using Linux native AIO\n2018-06-08 21:15:55 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins\n2018-06-08 21:15:55 0 [Note] InnoDB: Uses event mutexes\n2018-06-08 21:15:55 0 [Note] InnoDB: Compressed tables use zlib 1.2.8\n2018-06-08 21:15:55 0 [Note] InnoDB: Number of pools: 1\n2018-06-08 21:15:55 0 [Note] InnoDB: Using SSE2 crc32 instructions\n2018-06-08 21:15:55 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M\n2018-06-08 21:15:55 0 [Note] InnoDB: Completed initialization of buffer pool\n2018-06-08 21:15:55 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().\n2018-06-08 21:15:56 0 [Note] InnoDB: 128 out of 128 rollback segments are active.\n2018-06-08 21:15:56 0 [Note] InnoDB: Creating shared tablespace for temporary tables\n2018-06-08 21:15:56 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...\n2018-06-08 21:15:56 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.\n2018-06-08 21:15:56 0 [Note] InnoDB: 10.3.7 started; log sequence number 1639605; transaction id 39\n2018-06-08 21:15:56 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool\n2018-06-08 21:15:56 0 [Note] Plugin 'FEEDBACK' is disabled.\n2018-06-08 21:15:56 0 [Note] Server socket created on IP: '::'.\n2018-06-08 21:15:56 0 [Warning] 'proxies_priv' entry '@% root@9977cc179be0' ignored in --skip-name-resolve mode.\n2018-06-08 21:15:56 0 [Note] InnoDB: Buffer pool(s) load completed at 180608 21:15:56\n2018-06-08 21:15:56 0 [Note] Reading of all Master_info entries succeded\n2018-06-08 21:15:56 0 [Note] Added new Master_info '' to hash table\n2018-06-08 21:15:56 0 [Note] mysqld: ready for connections.\nVersion: '10.3.7-MariaDB-1:10.3.7+maria~jessie'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution\n\n}\u003e docker run -it --rm --link my-container mariadb:latest mariadb -hmy-container -uroot -proot myexample -e \"select * from mytable;\"\n+---------+\n| myfield |\n+---------+\n| Hello   |\n| Dolly   |\n+---------+\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flindycoder%2Fprepopulated-mysql-container-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flindycoder%2Fprepopulated-mysql-container-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flindycoder%2Fprepopulated-mysql-container-example/lists"}