3

如何使用Docker将PostgreSQL、MySQL、MariaDB 上的集成测试运行速度提高20倍?

 2 years ago
source link: https://www.jdon.com/57414
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如何使用Docker将PostgreSQL、MySQL、MariaDB 上的集成测试运行速度提高20倍?

来自 vladmihalcea的建议:在 tmpfs 上映射数据文件夹,可在使用Docker时,将PostgreSQL、MySQL、MariaDB 上的集成测试运行速度提高 20 倍!

只要在Docker run命令后增加一句:--tmpfs /var/lib/mysql:rw 

docker run \
--name mariadb \
-p 3306:3306 \
<p>[b]--tmpfs /var/lib/mysql:rw \[/b]
-e MYSQL_ROOT_PASSWORD=admin \
-e MYSQL_USER=hibernate_orm_test \
-e MYSQL_PASSWORD=hibernate_orm_test \
-e MYSQL_DATABASE=hibernate_orm_test  \
-d mariadb

更多其他数据库具体做法点击标题


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK