Not the answer you need?
Register and ask your own question!

How to make modifications to DB on Docker Container (table partitioning)

YeePYeeP ContributorCurrent User Role Beginner
I am using the "out of the box" Docker container that Percona has provided here: https://hub.docker.com/r/percona/percona-xtradb-cluster/. So we currently have a Galera Cluster running behind Zabbix, and I had to install xtrabackup because it is well suited for what we need. It looks like we are going to move these databases to a different part of the network and I would like to suggest we use the containers that Percona has created. However, we use partitioning on 7 of the tables I need that to be defined in the creation of the container/database. I have come up with a couple options but am looking for suggestions. The partitioning is all done in stored procedures, that I have driven by one main stored procedure which is called by a perl script, driven by a cron job....

Options:
1) Start up Docker container with -i -t in run command. Enter the DB and create stored procedures. (The data is a datadir outside the container so the stored procedures should be saved there once created). This is not really a Docker way of doing things.....

2) Modify the Dockerfile created by Percona to include the creation of the stored procedures. This is going to be difficult because I am behind a corporate firewall and I am almost guaranteed to have firewall issues when I try to build the container in my environment.

3) Is there a way to add something to the run command that can run a shell script to create the stored procedures?


Thank you for any suggestions!
Ryan
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.