{"id":16413723,"url":"https://github.com/startxfr/docker-db-tools","last_synced_at":"2025-07-19T22:04:33.764Z","repository":{"id":150318901,"uuid":"115513988","full_name":"startxfr/docker-db-tools","owner":"startxfr","description":"Container for database management with mysql and couchbase backend","archived":false,"fork":false,"pushed_at":"2020-03-07T10:00:26.000Z","size":313,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T21:04:32.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/startxfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-27T11:23:42.000Z","updated_at":"2020-03-07T10:00:31.000Z","dependencies_parsed_at":"2023-04-04T12:46:42.218Z","dependency_job_id":null,"html_url":"https://github.com/startxfr/docker-db-tools","commit_stats":null,"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/startxfr/docker-db-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/startxfr%2Fdocker-db-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/startxfr%2Fdocker-db-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/startxfr%2Fdocker-db-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/startxfr%2Fdocker-db-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/startxfr","download_url":"https://codeload.github.com/startxfr/docker-db-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/startxfr%2Fdocker-db-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026178,"owners_count":23866030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T06:52:12.452Z","updated_at":"2025-07-19T22:04:33.729Z","avatar_url":"https://github.com/startxfr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-db-tools ![sxapi](https://img.shields.io/badge/latest-v0.1.46-blue.svg)\n\nSXDbTools 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.\n\nFeatures list :\n\n- Dumping multiple buckets or database(s) content\n- Importing multiple dump into database(s) or bucket(s)\n- Creating bucket and/or database, user(s) + load data into couchbase or mysql\n- Deleting and Recreating bucket and/or database, user(s) + load data into couchbase or mysql\n- Creating multiple bucket or database user(s)\n- Deleting and Recreating multiple bucket or database user(s)\n- Creating multiple bucket(s) or database(s)\n- Deleting and Recreating multiple bucket(s) or database(s)\n- Backup multiple buckets or database(s) content into archives\n- Importing archive into buckets or database(s)\n- Use volume for persisting data and load data from external source\n- Use container linking to discover mysql credentials\n- Available as a s2i builder to build openshift pod ready to inject or backup couchbase cluser or mysql server\n\n[![Build Status](https://travis-ci.org/startxfr/docker-db-tools.svg?branch=master)](https://travis-ci.org/startxfr/docker-db-tools) [![docker build](https://img.shields.io/docker/build/startx/db-tools.svg)](https://hub.docker.com/r/startx/db-tools/) [![last commit](https://img.shields.io/github/last-commit/startxfr/docker-db-tools.svg)](https://github.com/startxfr/docker-db-tools) [![licence](https://img.shields.io/github/license/startxfr/docker-db-tools.svg)](https://github.com/startxfr/docker-db-tools)\n\n## Supported tags and respective Dockerfile links\n\nsx-dbtools is available from [dockerhub registry](https://hub.docker.com/) under the [startx namespace](https://hub.docker.com/r/startx/). You can use image name [startx/db-tools](https://hub.docker.com/r/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. \u003cbr\u003e\nHere is a list of the various available versions.\n\n| Docker tag   | branch / tag                                                                | Dockerfile                                                                            | Description                                                                                                                                               |\n| ------------ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `latest`     | [master](https://github.com/startxfr/docker-db-tools/blob/master)           | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/master/Dockerfile)      | Docker image with debug activated + local sample volume + local application volume + docker-compose test environment                                      |\n| `testing`    | [testing](https://github.com/startxfr/docker-db-tools/blob/testing)         | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/testing/Dockerfile)     | Docker image with debug activated + local sample volume + docker-compose test environment                                                                 |\n| `stable`     | [docker](https://github.com/startxfr/docker-db-tools/blob/docker)           | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/docker/Dockerfile)      | Docker image with debug desactivated                                                                                                                      |\n| `stable-s2i` | [s2i](https://github.com/startxfr/docker-db-tools/blob/s2i)                 | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/s2i/Dockerfile)         | Docker image with s2i config + debug desactivated                                                                                                         |\n| `0.1.46`     | [v0.1.46](https://github.com/startxfr/docker-db-tools/blob/v0.1.46)         | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/v0.1.46/Dockerfile)     | Latest release version coresponding to a fixed in time stable release (full list available on [tag list](https://hub.docker.com/r/startx/db-tools/tags/)) |\n| `0.1.46-s2i` | [v0.1.46-s2i](https://github.com/startxfr/docker-db-tools/blob/v0.1.46-s2i) | [Dockerfile](https://github.com/startxfr/docker-db-tools/blob/v0.1.46-s2i/Dockerfile) | Latest release version coresponding to a fixed in time stable release (full list available on [tag list](https://hub.docker.com/r/startx/db-tools/tags/)) |\n\n## Getting Started\n\n- [Docker user guide](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md) if you only have docker installed\n- [Docker-compose user guide](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md) if you have docker-compose installed\n- [Openshift user guide](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md) if you have access to an Openshift cluster or use s2i tools on top of docker\n\n## Linked services\n\nyou must tag properly the database service when you link your containers.\n\n| Link tag | Description                                                 |\n| -------- | :---------------------------------------------------------- |\n| dbm      | mysql container running offical `mariadb:10.0` image        |\n| dbc      | couchbase container running offical `couchbase:5.5.2` image |\n\nSee [docker linked services examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#linked-services), [docker-compose linked services examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#linked-services) or [openshift linked services examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#linked-services) for copy and paste examples.\n\n## Data volumes\n\nyou must use the appropriate data volumes and fill them with appropriate file to get your data\nloaded or dumped properly.\n\n| Container volume | Description                                                          |\n| ---------------- | :------------------------------------------------------------------- |\n| `/dump`          | volume containing a `mysql` directory and/or a `couchbase` directory |\n| `/backup`        | volume containing backup files                                       |\n\nSee [docker data volumes examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#data-volumes), [docker-compose data volumes examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#data-volumes) or [openshift data volumes examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#data-volumes) for copy and paste examples.\n\n## Environement variables\n\nUsing environement variable you can customize this tools and use it to interact with\nvarious kind of backend infrastructure (container, host, remote, IaaS, DBaaS)\n\n| Variable                |     Default     | Description                                                                                                                                                  |\n| ----------------------- | :-------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| SXCMD                   |                 | If set, container will execute this command instead of the container command (ex: SXCMD=\"create mysql demo2\" for creating the demo2 mysql database)          |\n| SXDBTOOLS_DEBUG         |      true       | Activate debugging display                                                                                                                                   |\n| SXDBTOOLS_BACKUP_DIR    |     /backup     | The final destination directory for backup                                                                                                                   |\n| SXDBTOOLS_DUMP_DIR      |      /dump      | The final destination directory for dump                                                                                                                     |\n| SXDBTOOLS_DELAY         |                 | Use this param with a positive integer to delay execution of the command                                                                                     |\n| MYSQL_DUMP_DIR          |   /dump/mysql   | Directory used for save and restore mysql dump (container internal path)                                                                                     |\n| MYSQL_DUMP_DATAFILE     |    data.sql     | Filename of the default sql data dump file                                                                                                                   |\n| MYSQL_DUMP_SCHEMAFILE   |   schema.sql    | Filename of the default sql schema dump file                                                                                                                 |\n| MYSQL_DUMP_ISEXTENDED   |      true       | Enable smart extended dump for fast load, readibility and versioning                                                                                         |\n| MYSQL_HOST              |       dbm       | Hostname of the mysql database. Could use whatever public IP or DSN.                                                                                         |\n| 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                             |\n| MYSQL_DATABASE          |                 | Mysql database name to use or create                                                                                                                         |\n| 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 |\n| COUCHBASE_DUMP_DIR      | /dump/couchbase | Directory used for save and restore couchbase dump (container internal path)                                                                                 |\n| COUCHBASE_DUMP_DATAFILE |    data.json    | Filename of the json data dump file                                                                                                                          |\n| COUCHBASE_HOST          |       dbc       | Hostname of the couchbase database. Could use whatever public IP or DSN.                                                                                     |\n| COUCHBASE_ADMIN         |     dev:dev     | Couchbase admin user and password (ex: user:password)                                                                                                        |\n| 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  |\n| COUCHBASE_BUCKET        |                 | Couchbase bucket name to use or create                                                                                                                       |\n\nSee [docker environement variables examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#environement-variables), [docker-compose environement variables examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#environement-variables) or [openshift environement variables examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#environement-variables) for copy and paste examples.\n\n## Actions you can perform\n\n### Global Commands\n\n| Command  | database-type   | options  | Description                                                                                   |\n| -------- | --------------- | -------- | --------------------------------------------------------------------------------------------- |\n| create   |                 |          | Create all user(s) + database(s) + data for all database type                                 |\n| create   | mysql/couchbase |          | Create all user(s) + database(s) + data for one database type (mysql or couchbase)            |\n| create   | mysql/couchbase | database | Create one database + data for one database type (mysql or couchbase)                         |\n| delete   |                 |          | Delete all user(s) + database(s) + data for all database type                                 |\n| delete   | mysql/couchbase |          | Delete all user(s) + database(s) + data for one database type (mysql or couchbase)            |\n| delete   | mysql/couchbase | database | Delete one database + data for one database type (mysql or couchbase)                         |\n| recreate |                 |          | Delete and create all user(s) + database(s) + data for all database type                      |\n| recreate | mysql/couchbase |          | Delete and create all user(s) + database(s) + data for one database type (mysql or couchbase) |\n| recreate | mysql/couchbase | database | Delete and create one database + data for one database type (mysql or couchbase)              |\n\nSee [docker global commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#global-commands), [docker-compose global commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#global-commands) or [openshift global commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#global-commands) for copy and paste examples.\n\n### Data Commands\n\n| Command     | database-type   | options  | Description                                                  |\n| ----------- | --------------- | -------- | ------------------------------------------------------------ |\n| dump        |                 |          | Dump all database(s) AND all bucket(s) in dump directory     |\n| dump        | mysql/couchbase |          | Dump all database(s) OR all bucket(s) in dump directory      |\n| dump        | mysql/couchbase | database | Dump only one database or bucket in dump directory           |\n| import      |                 |          | import all database(s) AND all bucket(s) from dump directory |\n| import      | mysql/couchbase |          | import all database(s) OR all bucket(s) from dump directory  |\n| import      | mysql/couchbase | database | import database(s) from dump directory                       |\n| create-data |                 |          | alias of import command                                      |\n\nSee [docker data commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#data-commands), [docker-compose data commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#data-commands) or [openshift data commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#data-commands) for copy and paste examples.\n\n### Backup / Restore Commands\n\n| Command | database-type   | options  | Description                                                                   |\n| ------- | --------------- | -------- | ----------------------------------------------------------------------------- |\n| backup  |                 |          | Backup database(s) in backup directory (not implemented)                      |\n| backup  | mysql/couchbase |          | Backup all database(s) or all bucket(s) in backup directory (not implemented) |\n| backup  | mysql/couchbase | database | Backup one database or bucket in backup directory (not implemented)           |\n| restore | archivename.tgz |          | Restore database(s) in backup directory (not implemented)                     |\n\nSee [docker backup/restore commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#backup--restore-commands), [docker-compose backup/restore commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#backup--restore-commands) or [openshift backup/restore commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#backup--restore-commands) for copy and paste examples.\n\n### Database Commands\n\n| Command     | database-type   | options  | Description                                                                  |\n| ----------- | --------------- | -------- | ---------------------------------------------------------------------------- |\n| create-db   |                 |          | Create all database(s) for all database type                                 |\n| create-db   | mysql/couchbase |          | Create all database(s) for one database type (mysql or couchbase)            |\n| create-db   | mysql/couchbase | database | Create one database for one database type (mysql or couchbase)               |\n| delete-db   |                 |          | Delete all database(s) for all database type                                 |\n| delete-db   | mysql/couchbase |          | Delete all database(s) for one database type (mysql or couchbase)            |\n| delete-db   | mysql/couchbase | database | Delete one database for one database type (mysql or couchbase)               |\n| recreate-db |                 |          | Delete and create all database(s) for all database type                      |\n| recreate-db | mysql/couchbase |          | Delete and create all database(s) for one database type (mysql or couchbase) |\n| recreate-db | mysql/couchbase | database | Delete and create one database for one database type (mysql or couchbase)    |\n\nSee [docker database commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#database-commands), [docker-compose database commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#database-commands) or [openshift database commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#database-commands) for copy and paste examples.\n\n### User management Commands\n\n| Command       | database-type   | options | Description                                                              |\n| ------------- | --------------- | ------- | ------------------------------------------------------------------------ |\n| create-user   |                 |         | Create all user(s) for all database type                                 |\n| create-user   | mysql/couchbase |         | Create all user(s) for one database type (mysql or couchbase)            |\n| create-user   | mysql/couchbase | user    | Create one user for one database type (mysql or couchbase)               |\n| delete-user   |                 |         | Delete all user(s) for all database type                                 |\n| delete-user   | mysql/couchbase |         | Delete all user(s) for one database type (mysql or couchbase)            |\n| delete-user   | mysql/couchbase | user    | Delete one user for one database type (mysql or couchbase)               |\n| recreate-user |                 |         | Delete and create all user(s) for all database type                      |\n| recreate-user | mysql/couchbase |         | Delete and create all user(s) for one database type (mysql or couchbase) |\n| recreate-user | mysql/couchbase | user    | Delete and create one user for one database type (mysql or couchbase)    |\n\nSee [docker user management commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#user-management-commands), [docker-compose user management commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#user-management-commands) or [openshift user management commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#user-management-commands) for copy and paste examples.\n\n### sx-dbtools Commands\n\n| Command | database-type | options | Description                                   |\n| ------- | ------------- | ------- | --------------------------------------------- |\n| usage   |               |         | usage message                                 |\n| \u003ccmd\u003e   | help          |         | display information about a command           |\n| info    |               |         | give information about the running sx-dbtools |\n| version |               |         | give the version of the running sx_dbtools    |\n| cmd     |               |         | return an interactive bash command            |\n| bash    |               |         | alias of command with no arguments            |\n| cmd     | command       |         | execute the command and return result         |\n| daemon  |               |         | container never giveup and run permanently    |\n\nSee [docker sx-dbtools commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_docker.md#sx-dbtools-commands), [docker-compose sx-dbtools commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_compose.md#sx-dbtools-commands) or [openshift sx-dbtools commands examples](https://github.com/startxfr/docker-db-tools/tree/master/docs/USE_openshift.md#sx-dbtools-commands) for copy and paste examples.\n\n## Troubleshooting\n\nIf you run into difficulties installing or running db-tools, you can [create an issue](https://github.com/startxfr/docker-db-tools/issues/new).\n\n## Built With\n\n- [docker](https://www.docker.com/) - Container plateform\n- [couchbase](https://couchbase.com/) - NoSQL Backend\n- [mariadb](https://mariadb.org) - SQL Backend\n\n## Contributing\n\nRead the [contributing guide](https://github.com/startxfr/sxapi-core/tree/master/docs/5.Contribute.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Authors\n\nThis project is mainly developped by the [startx](https://www.startx.fr) dev team. You can see the complete list of contributors who participated in this project by reading [CONTRIBUTORS.md](https://github.com/startxfr/sxapi-core/tree/master/docs/CONTRIBUTORS.md).\n\n## License\n\nThis project is licensed under the Apache License Version 2.0 - see the [LICENSE](https://github.com/startxfr/docker-db-tools/tree/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartxfr%2Fdocker-db-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstartxfr%2Fdocker-db-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartxfr%2Fdocker-db-tools/lists"}