All Projects → lindycoder → prepopulated-mysql-container-example

lindycoder / prepopulated-mysql-container-example

Licence: other
This is an example on how to make a prepopulated container image.

Projects that are alternatives of or similar to prepopulated-mysql-container-example

akk-stack
Containerized EverQuest Emulator Server Environment
Stars: ✭ 36 (-40.98%)
Mutual labels:  container, mariadb
Mariadb Container
MariaDB container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 19 (-68.85%)
Mutual labels:  container, mariadb
db-command
Performs basic database operations using credentials stored in wp-config.php.
Stars: ✭ 65 (+6.56%)
Mutual labels:  mariadb
BitLens
🔎 Have your bits and eat them too! A C++17 bit lens container for vector types.
Stars: ✭ 20 (-67.21%)
Mutual labels:  container
mariadb-cluster
MariaDB Galera cluster running on CoreOS using the official Docker images
Stars: ✭ 11 (-81.97%)
Mutual labels:  mariadb
docker-compose-all-mysql
MySQL and MariaDB docker containers of MySQL v5.5, v5.6, v5.7, v8.0, mariadb v10.0, v10.1, v10.2, v10.3
Stars: ✭ 105 (+72.13%)
Mutual labels:  mariadb
exposed-upsert
Upsert DSL extension for Exposed, Kotlin SQL framework
Stars: ✭ 21 (-65.57%)
Mutual labels:  mariadb
softwarecontainer
Framework to manage and contain applications in an automotive setting
Stars: ✭ 19 (-68.85%)
Mutual labels:  container
nocodb
🔥 🔥 🔥 Open Source Airtable Alternative - turns any MySQL, Postgres, SQLite into a Spreadsheet with REST APIs.
Stars: ✭ 28,894 (+47267.21%)
Mutual labels:  mariadb
docker-iot-stack
💻 My personal Docker IoT Stack
Stars: ✭ 24 (-60.66%)
Mutual labels:  mariadb
chubbyphp-container
A minimal Dependency Injection Container (DIC) which implements PSR-11.
Stars: ✭ 14 (-77.05%)
Mutual labels:  container
devtoolset-container
Devtoolset container images based on Red Hat Software Collections, that provide a platform for building and running C and C++ applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
Stars: ✭ 40 (-34.43%)
Mutual labels:  container
docker-tor
TOR Server Docker image
Stars: ✭ 32 (-47.54%)
Mutual labels:  container
MySQL MariaDB Generic
This MySQL_MariaDB_Generic library helps you connect your boards directly to a MySQL / MariaDB server, either local or cloud-based, so that you can store / retrieve data to / from the server. Supported boards are ESP8266/ESP32, WT32_ETH01 (ESP32 + LAN8720A), nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, Teensy, SAM DUE, Mega, RP2040-based boards, P…
Stars: ✭ 35 (-42.62%)
Mutual labels:  mariadb
government-frontend
Serves government pages on GOV.UK
Stars: ✭ 42 (-31.15%)
Mutual labels:  container
SeleniumDemo
Selenium automation test framework
Stars: ✭ 84 (+37.7%)
Mutual labels:  container
container-security-book
container-security.dev/
Stars: ✭ 123 (+101.64%)
Mutual labels:  container
dioc
A dart simple dependency container based on code generation.
Stars: ✭ 47 (-22.95%)
Mutual labels:  container
docker-ttrss
Tiny Tiny RSS feed reader as a Docker image.
Stars: ✭ 55 (-9.84%)
Mutual labels:  container
CNeptune
CNeptune improve productivity & efficiency by urbanize .net module with meta-code to lay foundation for frameworks
Stars: ✭ 30 (-50.82%)
Mutual labels:  container

A prepopulated mysql container ?

Yeah why not, i like my test faster :D

But how ?

The mysql/mariadb container image contain an init script that will execute everything in /docker-entrypoint-initdb.d/

see Initializing a fresh instance @ https://hub.docker.com/_/mariadb/

So let's run this initialization in a multi-stage build and copy the initialized DB in the new image :D

(see comments in dockerfile for details of the hack)

Try it!

Clone this, then...

}> docker build --tag my-prepopulated-image .
...

}> docker run -d --rm --name my-container my-prepopulated-image
...

}> docker logs my-container

(there was is initialization here, therefore we win)

2018-06-08 21:15:55 0 [Note] mysqld (mysqld 10.3.7-MariaDB-1:10.3.7+maria~jessie) starting as process 1 ...
2018-06-08 21:15:55 0 [Note] InnoDB: Using Linux native AIO
2018-06-08 21:15:55 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-06-08 21:15:55 0 [Note] InnoDB: Uses event mutexes
2018-06-08 21:15:55 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-06-08 21:15:55 0 [Note] InnoDB: Number of pools: 1
2018-06-08 21:15:55 0 [Note] InnoDB: Using SSE2 crc32 instructions
2018-06-08 21:15:55 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2018-06-08 21:15:55 0 [Note] InnoDB: Completed initialization of buffer pool
2018-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().
2018-06-08 21:15:56 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-06-08 21:15:56 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-06-08 21:15:56 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-06-08 21:15:56 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-06-08 21:15:56 0 [Note] InnoDB: 10.3.7 started; log sequence number 1639605; transaction id 39
2018-06-08 21:15:56 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-06-08 21:15:56 0 [Note] Plugin 'FEEDBACK' is disabled.
2018-06-08 21:15:56 0 [Note] Server socket created on IP: '::'.
2018-06-08 21:15:56 0 [Warning] 'proxies_priv' entry '@% root@9977cc179be0' ignored in --skip-name-resolve mode.
2018-06-08 21:15:56 0 [Note] InnoDB: Buffer pool(s) load completed at 180608 21:15:56
2018-06-08 21:15:56 0 [Note] Reading of all Master_info entries succeded
2018-06-08 21:15:56 0 [Note] Added new Master_info '' to hash table
2018-06-08 21:15:56 0 [Note] mysqld: ready for connections.
Version: '10.3.7-MariaDB-1:10.3.7+maria~jessie'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

}> docker run -it --rm --link my-container mariadb:latest mysql -hmy-container -uroot -proot myexample -e "select * from mytable;"
+---------+
| myfield |
+---------+
| Hello   |
| Dolly   |
+---------+
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].