Container for database management with mysql and couchbase backend
5.9K
SXDbTools is a container for managing data from and to a mysql and/or a couchbase backend. All command work with a couchbase cluser and / or a mysql server the same way.
Features list :
sx-dbtools is available from dockerhub registry under the startx namespace. You can use image name startx/db-tools to access this image. Add a flavour to get the desired version, for example docker pull startx/db-tools:latest for the latest version.
Here is a list of the various available versions.
| Docker tag | branch / tag | Dockerfile | Description |
|---|---|---|---|
latest | master | Dockerfile | Docker image with debug activated + local sample volume + local application volume + docker-compose test environment |
testing | testing | Dockerfile | Docker image with debug activated + local sample volume + docker-compose test environment |
stable | docker | Dockerfile | Docker image with debug desactivated |
stable-s2i | s2i | Dockerfile | Docker image with s2i config + debug desactivated |
0.1.46 | v0.1.46 | Dockerfile | Latest release version coresponding to a fixed in time stable release (full list available on tag list) |
0.1.46-s2i | v0.1.46-s2i | Dockerfile | Latest release version coresponding to a fixed in time stable release (full list available on tag list) |
you must tag properly the database service when you link your containers.
| Link tag | Description |
|---|---|
| dbm | mysql container running offical mariadb:10.0 image |
| dbc | couchbase container running offical couchbase:5.5.2 image |
See docker linked services examples, docker-compose linked services examples or openshift linked services examples for copy and paste examples.
you must use the appropriate data volumes and fill them with appropriate file to get your data loaded or dumped properly.
| Container volume | Description |
|---|---|
/dump | volume containing a mysql directory and/or a couchbase directory |
/backup | volume containing backup files |
See docker data volumes examples, docker-compose data volumes examples or openshift data volumes examples for copy and paste examples.
Using environement variable you can customize this tools and use it to interact with various kind of backend infrastructure (container, host, remote, IaaS, DBaaS)
| Variable | Default | Description |
|---|---|---|
| SXCMD | If set, container will execute this command instead of the container command (ex: SXCMD="create mysql demo2" for creating the demo2 mysql database) | |
| SXDBTOOLS_DEBUG | true | Activate debugging display |
| SXDBTOOLS_BACKUP_DIR | /backup | The final destination directory for backup |
| SXDBTOOLS_DUMP_DIR | /dump | The final destination directory for dump |
| SXDBTOOLS_DELAY | Use this param with a positive integer to delay execution of the command | |
| MYSQL_DUMP_DIR | /dump/mysql | Directory used for save and restore mysql dump (container internal path) |
| MYSQL_DUMP_DATAFILE | data.sql | Filename of the default sql data dump file |
| MYSQL_DUMP_SCHEMAFILE | schema.sql | Filename of the default sql schema dump file |
| MYSQL_DUMP_ISEXTENDED | true | Enable smart extended dump for fast load, readibility and versioning |
| MYSQL_HOST | dbm | Hostname of the mysql database. Could use whatever public IP or DSN. |
| MYSQL_ADMIN | [linked user] | Mysql admin user and password (ex: user:password). Default will use root and MYSQL_ROOT_PASSWORD found into the linked container |
| MYSQL_DATABASE | Mysql database name to use or create | |
| MYSQL_USERS | Mysql list of users to the database "," is separator between users and ":" between user and his password. ex : user:password,user2:user2Password,user3,user4 | |
| COUCHBASE_DUMP_DIR | /dump/couchbase | Directory used for save and restore couchbase dump (container internal path) |
| COUCHBASE_DUMP_DATAFILE | data.json | Filename of the json data dump file |
| COUCHBASE_HOST | dbc | Hostname of the couchbase database. Could use whatever public IP or DSN. |
| COUCHBASE_ADMIN | dev:dev | Couchbase admin user and password (ex: user:password) |
| COUCHBASE_USERS | Mysql list of users to the cluster "," is separator between users and ":" between user and his password. ex : user:password,user2:user2Password,user3,user4 | |
| COUCHBASE_BUCKET | Couchbase bucket name to use or create |
See docker environement variables examples, docker-compose environement variables examples or openshift environement variables examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| create | Create all user(s) + database(s) + data for all database type | ||
| create | mysql/couchbase | Create all user(s) + database(s) + data for one database type (mysql or couchbase) | |
| create | mysql/couchbase | database | Create one database + data for one database type (mysql or couchbase) |
| delete | Delete all user(s) + database(s) + data for all database type | ||
| delete | mysql/couchbase | Delete all user(s) + database(s) + data for one database type (mysql or couchbase) | |
| delete | mysql/couchbase | database | Delete one database + data for one database type (mysql or couchbase) |
| recreate | Delete and create all user(s) + database(s) + data for all database type | ||
| recreate | mysql/couchbase | Delete and create all user(s) + database(s) + data for one database type (mysql or couchbase) | |
| recreate | mysql/couchbase | database | Delete and create one database + data for one database type (mysql or couchbase) |
See docker global commands examples, docker-compose global commands examples or openshift global commands examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| dump | Dump all database(s) AND all bucket(s) in dump directory | ||
| dump | mysql/couchbase | Dump all database(s) OR all bucket(s) in dump directory | |
| dump | mysql/couchbase | database | Dump only one database or bucket in dump directory |
| import | import all database(s) AND all bucket(s) from dump directory | ||
| import | mysql/couchbase | import all database(s) OR all bucket(s) from dump directory | |
| import | mysql/couchbase | database | import database(s) from dump directory |
| create-data | alias of import command |
See docker data commands examples, docker-compose data commands examples or openshift data commands examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| backup | Backup database(s) in backup directory (not implemented) | ||
| backup | mysql/couchbase | Backup all database(s) or all bucket(s) in backup directory (not implemented) | |
| backup | mysql/couchbase | database | Backup one database or bucket in backup directory (not implemented) |
| restore | archivename.tgz | Restore database(s) in backup directory (not implemented) |
See docker backup/restore commands examples, docker-compose backup/restore commands examples or openshift backup/restore commands examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| create-db | Create all database(s) for all database type | ||
| create-db | mysql/couchbase | Create all database(s) for one database type (mysql or couchbase) | |
| create-db | mysql/couchbase | database | Create one database for one database type (mysql or couchbase) |
| delete-db | Delete all database(s) for all database type | ||
| delete-db | mysql/couchbase | Delete all database(s) for one database type (mysql or couchbase) | |
| delete-db | mysql/couchbase | database | Delete one database for one database type (mysql or couchbase) |
| recreate-db | Delete and create all database(s) for all database type | ||
| recreate-db | mysql/couchbase | Delete and create all database(s) for one database type (mysql or couchbase) | |
| recreate-db | mysql/couchbase | database | Delete and create one database for one database type (mysql or couchbase) |
See docker database commands examples, docker-compose database commands examples or openshift database commands examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| create-user | Create all user(s) for all database type | ||
| create-user | mysql/couchbase | Create all user(s) for one database type (mysql or couchbase) | |
| create-user | mysql/couchbase | user | Create one user for one database type (mysql or couchbase) |
| delete-user | Delete all user(s) for all database type | ||
| delete-user | mysql/couchbase | Delete all user(s) for one database type (mysql or couchbase) | |
| delete-user | mysql/couchbase | user | Delete one user for one database type (mysql or couchbase) |
| recreate-user | Delete and create all user(s) for all database type | ||
| recreate-user | mysql/couchbase | Delete and create all user(s) for one database type (mysql or couchbase) | |
| recreate-user | mysql/couchbase | user | Delete and create one user for one database type (mysql or couchbase) |
See docker user management commands examples, docker-compose user management commands examples or openshift user management commands examples for copy and paste examples.
| Command | database-type | options | Description |
|---|---|---|---|
| usage | usage message | ||
| help | display information about a command | ||
| info | give information about the running sx-dbtools | ||
| version | give the version of the running sx_dbtools | ||
| cmd | return an interactive bash command | ||
| bash | alias of command with no arguments | ||
| cmd | command | execute the command and return result | |
| daemon | container never giveup and run permanently |
See docker sx-dbtools commands examples, docker-compose sx-dbtools commands examples or openshift sx-dbtools commands examples for copy and paste examples.
If you run into difficulties installing or running db-tools, you can create an issue.
Read the contributing guide for details on our code of conduct, and the process for submitting pull requests to us.
This project is mainly developped by the startx dev team. You can see the complete list of contributors who participated in this project by reading CONTRIBUTORS.md.
This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details
Content type
Image
Digest
Size
423.9 MB
Last updated
over 5 years ago
docker pull startx/db-tools