Fix: Recognize container that uses multiple DBs#6
Conversation
Improvement: Allow backup of all databases
| RUN \ | ||
| apt-get -y update && \ | ||
| apt-get -y install mydumper && \ | ||
| apt-get -y install mydumper git sudo && \ |
There was a problem hiding this comment.
I introduced the hooks to be able to create a simple script that commits the changes after every backup automatically. So it was required to have git available inside the docker.
| 'BACKUP') | ||
| OPTIONS=${OPTIONS:-} | ||
| ;; | ||
| 'COMPRESSED_BACKUP') |
There was a problem hiding this comment.
Why not just overwriting OPTIONS?
|
|
||
| echo "===> Starting backup..." | ||
| exec su -pc "mydumper ${CLI_OPTIONS}" ${USER} | ||
| sudo -u ${USER} mydumper ${CLI_OPTIONS} |
There was a problem hiding this comment.
Is the container properly "stoppable" (i.e. docker stop container vs docker kill container) with just sudo?
There was a problem hiding this comment.
Hmm, I haven't tested this yet. Changing from exec to sudo was required to be able to call the hooks afterwards, because exec will not continue with the execution of this script.
| # | ||
| # Call after hooks | ||
| # | ||
| if [ -d "/hooks" ] && ls /hooks/*.after 1> /dev/null 2>&1; then |
|
Oh I just wanted to create a pull request for the first commit b62f0f4. The other two commits just contained stuff I needed for my internal purpose and it wasn't planned to include them in this pull request (e. g. that's why I just added |
The docker container doesn't work with my linked in mariadb container. It has issues, because the env. variable
*_ENV_MYSQL_DATABASEis not available.I changed the behaviour so that this variable isn't required anymore. If it is not available mydumper will create a backup for all databases.