Sign inSign up

bbtsoftwareag/mssql-backup

By bbtsoftwareag

•Updated about 2 years ago

Docker image for periodic backups from a Microsoft SQL Server container

Image
0

100K+

bbtsoftwareag/mssql-backup repository overview

⁠Docker image for backup of Microsoft SQL Server

Docker image to create regular backups of a Microsoft SQL Server⁠ image.

⁠Information

ServiceStats
DockerBuild Pulls Stars Automated
GitHubLast commit Issues PR Size License

⁠General

TopicDescription
ImageSee Docker Hub⁠.
SourceSee GitHub⁠.

⁠Usage

This container can create backups on a Microsoft SQL Server⁠ container.

NOTE: The backup is written to a directory /backup inside the Microsoft SQL Server⁠ container, not to a volume in the backup container. For using the cleanup feature attach the same /backup volume in the bbtsoftwareag/mssql-backup container.

⁠Tags
TagDescriptionSize
latestLatest master buildSize
0.1.0Release 0.1.0⁠Size
0.2.0Release 0.2.0⁠Size
0.3.0Release 0.3.0⁠Size
0.4.0Release 0.4.0⁠Size
0.5.0Release 0.5.0⁠Size
0.5.1Release 0.5.1⁠Size
⁠Configuration

These environment variables are supported:

Environment variableDefault valueDescription
DB_SERVERmssqlName or address of the database server to backup. Normally this should be the name of the Microsoft SQL Server⁠ service.
DB_USERSAUser used to connect to the database server.
DB_PASSWORDPassword used to connect to the database server.
DB_NAMESNames of the databases for which a backup should be created.
TZTimezone to use.
CRON_SCHEDULE0 1 * * sunCron 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.
BACKUP_CLEANUPfalseSet to "true" if you want to let the cronjob remove files older than $BACKUP_AGE days
BACKUP_AGE7Number of days to keep backups in backup directory
SKIP_BACKUP_LOGfalseSkip step to backup the transaction log .
PACKPossible values: tar, zip. If defined, compresses the output files into a single .tar.gz (or zip)-File.
ZIP_PASSWORDSets the password for the zip to the given value. Only works if PACK is set to zip
PUSH_REMOTE_MODEThe possible values move or copy activates pushing the backup files to a mapped remote directory. The volume remote must be mapped.
SMTP_HOSTIf this is set, email reporting is enabled by sending the results of the backup process to MAIL_TO. You pretty much have to define all the other SMTP_* variables, when the host is defined.
SMTP_PORTThe port of the SMTP server
SMTP_USERThe username used to login against the SMTP server
SMTP_PASSThe password for connecting to the SMTP server
SMTP_FROMThe E-mail address from which mails should be sent from
SMTP_TLSonWhether TLS should be used when connecting to the SMTP server
MAIL_TOThe target E-mail address for receiving mail reports

⁠Examples

⁠Docker Compose

The following example will create backups of the databases MyFirstDatabaseToRestore and MySecondDatabaseToRestore running inside the db container every day at 01.00 CEST and stores it in the /storage/backup directory on the host machine.

version: '3.7'

services:
  db:
    image: mcr.microsoft.com/mssql/server
    volumes:
      - /storage/backup:/backup
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_PID=Express
      - SA_PASSWORD=MySecre(12)tPassword
    networks:
      - default
  backup:
    image: bbtsoftwareag/mssql-backup
    # for using the cleanup feature, use the backup volume from db.
    # volumes:
    #   - /storage/backup:/backup
    environment:
      - TZ=Europe/Zurich
      - DB_SERVER=db
      - DB_USER=SA
      - DB_PASSWORD=MySecre(12)tPassword
      - "DB_NAMES=
          MyFirstDatabaseToRestore
          MySecondDatabaseToRestore"
      - CRON_SCHEDULE=0 1 * * *
    networks:
      - default
⁠Example environment

We added a small docker environment in the example⁠ subdirectory for development or tests with a own readme⁠ file.

⁠Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the BBT Software docker-mssql-backup repository⁠.

Join in the discussion on the BBT Software docker-mssql-backup repository

⁠Contributing

Contributions are welcome. See Contribution Guidelines⁠.

Tag summary

Content type

Image

Digest

sha256:d3ef6ec1f…

Size

112.9 MB

Last updated

about 2 years ago

docker pull bbtsoftwareag/mssql-backup