Deploying MySQL on Linux with Docker --rm mysql/enterprise-server:8.0 \ mysqlbackup --backup-dir=/tmp/backup-tmp --with-timestamp \ --datadir=/var/lib/mysql --backup-image=/data/backups/db.mbi copy-back-and-apply-log [Entrypoint] MySQL Docker Image 8.0.11-1.1.5 MySQL Enterprise Backup version 8.0.11 Linux-4.1.12-61.1.16.el7uek.x86_64-x86_64 [2018-04-08 07:06:45] Copyright (c) 2003, 2018, Oracle and/or its affiliates. All Rights Reserved. 180921 22:06:52 MAIN INFO: A thread created with Id ’139768047519872’ 180921 22:06:52 MAIN INFO: Starting with following command line ... ... 180921 22:06:52 PCR1 INFO: We were able to parse ibbackup_logfile up to lsn 29680612. 180921 22:06:52 PCR1 INFO: Last MySQL binlog file position 0 155, file name binlog.000003 180921 22:06:52 PCR1 INFO: The first data file is ’/var/lib/mysql/ibdata1’ and the new created log files are at ’/var/lib/mysql’ 180921 22:06:52 MAIN INFO: No Keyring file to process. 180921 22:06:52 MAIN INFO: Apply-log operation completed successfully. 180921 22:06:52 MAIN INFO: Full Backup has been restored successfully. mysqlbackup completed OK! with 3 warnings The container exits once the backup job is finished and, with the  --rm  option used when starting it, it is removed after it exits. Or, start a new MySQL Server on the restored data directory: docker restart mysqlserver 4. Restart the server container, which also restarts the restored server: Log on to the server to check that the server is running with the restored data. Known Issues Docker Environment Variables •When using the server system variable  audit_log_file  to configure the audit log file name, use the loose  option modifier with it, or Docker will be unable to start the server. docker run --name=mysqlserver2 \ --mount type=bind,src= /path-on-host-machine/datadir/ ,dst=/var/lib/mysql \ -d mysql/enterprise-server:8.0 When you create a MySQL Server container, you can configure the MySQL instance by using the  --env option ( -e  in short) and specifying one or more of the following environment variables. •None of the variables below has any effect if the data directory you mount is not empty, as no server initialization is going to be attempted then (see Persisting Data and Configuration Changes for more details). Any pre-existing contents in the folder, including any old server settings, are not modified during the container startup. •The boolean variables including  MYSQL_RANDOM_ROOT_PASSWORD , MYSQL_ONETIME_PASSWORD ,  MYSQL_ALLOW_EMPTY_PASSWORD , and MYSQL_LOG_CONSOLE  are made true by setting them with any strings of nonzero lengths. Therefore, setting them to, for example, “0” , “false” , or “no”  does not make them false, but actually makes them true. This is a known issue of the MySQL Server containers. Notes 192