|
1 | | -# docker-mssql-backup |
2 | | -Docker images for periodic backups from an Microsoft SQL Server container |
| 1 | +# Docker image for backup of Microsoft SQL Server |
| 2 | + |
| 3 | +Docker image to create regular backups of a [Microsoft SQL Server] image. |
| 4 | + |
| 5 | +## Information |
| 6 | + |
| 7 | +| Service | Stats | |
| 8 | +|---------|-------------------------------------------------------------------------------------------| |
| 9 | +| Docker | [](https://hub.docker.com/r/bbtsoftwareag/mssql-backup/builds) [](https://hub.docker.com/r/bbtsoftwareag/mssql-backup) [](https://hub.docker.com/r/bbtsoftwareag/mssql-backup) [](https://hub.docker.com/r/bbtsoftwareag/mssql-backup/builds) | |
| 10 | +| GitHub | [](https://github.com/bbtsoftware/docker-mssql-backup/commits/master) [](https://github.com/bbtsoftware/docker-mssql-backup/issues) [](https://github.com/bbtsoftware/docker-mssql-backup/pulls) [](https://github.com/bbtsoftware/docker-mssql-backup/) [](https://github.com/bbtsoftware/docker-mssql-backup/blob/master/LICENSE) | |
| 11 | + |
| 12 | +## General |
| 13 | + |
| 14 | +| Topic | Description | |
| 15 | +|--------|------------------------------------------------------------------------| |
| 16 | +| Image | See [Docker Hub](https://hub.docker.com/r/bbtsoftwareag/mssql-backup). | |
| 17 | +| Source | See [GitHub](https://github.com/bbtsoftware/docker-mssql-backup). | |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | +This container can create backups on a [Microsoft SQL Server] container. |
| 22 | + |
| 23 | +**NOTE:** |
| 24 | +The backup is written to a directory `/backup` inside the [Microsoft SQL Server] container, not to a volume in the backup container. |
| 25 | + |
| 26 | +### Tags |
| 27 | + |
| 28 | +| Tag | Description | Size | |
| 29 | +|--------|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| |
| 30 | +| latest | Latest master build |  | |
| 31 | +| 0.1.0 | Release [0.1.0](https://github.com/bbtsoftware/docker-mssql-backup/releases/tag/0.1.0) |  | |
| 32 | + |
| 33 | +### Configuration |
| 34 | + |
| 35 | +These environment variables are supported: |
| 36 | + |
| 37 | +| Environment variable | Default value | Description | |
| 38 | +|----------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 39 | +| DB_SERVER | `mssql` | Name or address of the database server to backup. Normally this should be the name of the [Microsoft SQL Server] service. | |
| 40 | +| DB_USER | `SA` | User used to connect to the database server. | |
| 41 | +| DB_PASSWORD | | Password used to connect to the database server. | |
| 42 | +| DB_NAMES | | Names of the databases for which a backup should be created. | |
| 43 | +| TZ | | Timezone to use. | |
| 44 | +| CRON_SCHEDULE | `0 1 * * sun` | Cron schedule for running backups. NOTE: There is no check if there's already a backup running when starting the backup job. Therefore time interval needs to be longer than the maximum expected backup time for all databases. | |
| 45 | + |
| 46 | +## Examples |
| 47 | + |
| 48 | +### Docker Compose |
| 49 | + |
| 50 | +The following example will create backups of the databases `MyFirstDatabaseToRestore` and `MySecondDatabaseToRestore` |
| 51 | +running inside the `db` container every day at 01.00 CEST and stores it in the `/storage/backup` directory on the host machine. |
| 52 | + |
| 53 | +```yaml |
| 54 | +version: '3.7' |
| 55 | + |
| 56 | +services: |
| 57 | + db: |
| 58 | + image: mcr.microsoft.com/mssql/server |
| 59 | + volumes: |
| 60 | + - /storage/backup:/backup |
| 61 | + environment: |
| 62 | + - ACCEPT_EULA=Y |
| 63 | + - MSSQL_PID=Express |
| 64 | + - SA_PASSWORD=MySecretPassword |
| 65 | + networks: |
| 66 | + - default |
| 67 | + backup: |
| 68 | + image: bbtsoftwareag/mssql-backup |
| 69 | + environment: |
| 70 | + - TZ=Europe/Zurich |
| 71 | + - DB_SERVER=db |
| 72 | + - DB_USER=SA |
| 73 | + - DB_PASSWORD=MySecretPassword |
| 74 | + - "DB_NAMES= |
| 75 | + MyFirstDatabaseToRestore |
| 76 | + MySecondDatabaseToRestore" |
| 77 | + - CRON_SCHEDULE="0 1 * * *" |
| 78 | + networks: |
| 79 | + - default |
| 80 | +``` |
| 81 | +
|
| 82 | +[Microsoft SQL Server]: https://hub.docker.com/_/microsoft-mssql-server |
0 commit comments