1
1
# Docker-mysql-backup-azure
2
2
3
- mysql container to backup your database's to Microsoft Azure Storare
3
+ container to backup your mysql database's to Microsoft Azure Storare.
4
4
5
- # Variables you must define when you run the container
5
+ # Environment variables
6
6
7
- - ` $DB_PASSWORD ` - The password to connect with Mysql
8
- - ` $DB_USER ` - The username to connect with Mysql
9
- - ` $DB_NAME ` - Database name
10
- - ` $CONTAINER ` - Container name in azure
11
- - ` $AZURE_STORAGE_ACCOUNT ` - Name of Azure Storare Account
12
- - ` $AZURE_STORAGE_ACCESS_KEY ` - Acess Key for Storage Account
13
- - ` $MYSQL_PORT ` - Port to connect with Mysql. default 3306
14
- - ` $MYSQL_HOST ` - Host where mysql is running
15
- - ` $FILENAME ` - Name to file in Azure Storage. Default name default-date +"%Y-%m-%d_ %H-%M"`
16
- output will be ` default-2015-08-03_17-58 `
7
+ - _ ` $DB_PASSWORD ` _ - The password to connect with Mysql
8
+ - _ ` $DB_USER ` _ - The username to connect with Mysql
9
+ - _ ` $DB_NAME ` _ - Database name
10
+ - _ ` $CONTAINER ` _ - Container name in azure
11
+ - _ ` $AZURE_STORAGE_ACCOUNT ` _ - Name of Azure Storare Account
12
+ - _ ` $AZURE_STORAGE_ACCESS_KEY ` _ - Acess Key for Storage Account
13
+ - _ ` $MYSQL_PORT ` _ - Port to connect with Mysql. default 3306
14
+ - _ ` $MYSQL_HOST ` _ - Host where mysql is running
15
+ - _ ` $FILENAME ` _ - Name to file in Azure Storage. Default name ` default-date +"%Y-%m-%d_%H-%M" ` output example ` default-2015-08-03_17-58 `
16
+
17
+ # Container startup explained
18
+
19
+ * Mysql will acess to the host where is database you want to backup
20
+ * Mysql will dump the database to this container and compress it using gzip
21
+ * Using azure-cli the file will be uploaded to Azure Storage
22
+ * Container will exit
17
23
18
24
# Example of running
19
25
@@ -30,3 +36,13 @@ docker run -rm --name mysql-backup \
30
36
fernandoneto/docker-mysql-backup-azure
31
37
32
38
```
39
+
40
+ This will upload to Azure Stora a file named ` default-2015-08-04_09-47.sql.gz `
41
+
42
+ ## Developing
43
+
44
+ ### Building image
45
+
46
+ ``` bash
47
+ docker build -t fernandoneto/docker-mysql-backup-azure .
48
+ ```
0 commit comments