using mysql-client in docker container to dump special table schema and data with conditions
.
├── configs
│ └── .env.default # env example
├── out # dump result
├── targets # special DB, table, fields, conditions config
├── .gitignore # git ignore config
├── Dockerfile # operation env instructions
├── dump # script
└── Makefile # script entry point
Before run the script, you need create
env file
in configs folder andtarget file
in targets folder to define MySQL connect information and what DB and tables data you want.
field | description |
---|---|
env_file_name | env file name in config folder |
target_file_name | target file name in targets folder |
docker_network_name (optional) | docker network name, if you need operate container in exist network, you can set it. |
docker_container_name (optional) | docker container name that you want to link. |
make run <env_file_name> <target_file_name> [docker_network_name] [docker_container_name]