How to create populated MySQL Docker Image on build time

前端 未结 6 701
借酒劲吻你
借酒劲吻你 2020-12-09 03:59

I would like to create a MySQL Docker image with data already populated.

I want to create 3 layers like this:

        |---------------------|--------         


        
6条回答
  •  爱一瞬间的悲伤
    2020-12-09 04:33

    Building on MegaWubs's answer, I found this Dockerfile to be sufficient.

    FROM mysql:5.6
    RUN sed -i 's|/var/lib/mysql|/var/lib/mysql2|g' /etc/mysql/my.cnf
    

提交回复
热议问题