Mariadb-docker: Option to not initialise database

Created on 4 Jul 2016  路  4Comments  路  Source: MariaDB/mariadb-docker

Can you please give the option to not initialise the database on startup via an envvar? Otherwise this will not work well with Galera SST, as it attempts to do SST during entrypoint init.

Most helpful comment

@foxx see https://gist.github.com/tanji/919c0dca2e3679acecd7d8cf2a3a886e for an example of how to do it with compose.

All 4 comments

I think this is accomplished by just skipping the entrypoint script (--entrypoint mysqld). It only provides a few things, most of which you don't want on the cluster node anyway:

  • chown /var/lib/mysql

    • if bind mounting a directory from the host, just make sure the permissions are correct

  • switch user from root to mysql user

    • just use --user on your docker run: docker run --user mysql ... mysql

  • initdb including root password and user creation from environment variables (not wanted on a cluster replica)
  • run scripts in /docker-entrypoint-initdb.d/ (also not wanted on the replica)

@foxx see https://gist.github.com/tanji/919c0dca2e3679acecd7d8cf2a3a886e for an example of how to do it with compose.

Thanks for the solutions! Should this go into the README or something?

Closing old issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eipiminus1 picture eipiminus1  路  9Comments

andrerom picture andrerom  路  5Comments

dbjpanda picture dbjpanda  路  5Comments

iBobik picture iBobik  路  7Comments

benkaiser picture benkaiser  路  4Comments