Public | Automated Build

Last pushed: a year ago
Short Description
Full installation of Bareos, a fork of Bacula
Full Description


Bareos on Docker

Bareos is a fork of the well know backup solution "Bacula"

This Bareos installation on Docker comes with integrated mysql backend and Bareos Webui.
Database files and configuration are mapped to volumes. It was made to run on a Synology


Variables must be predefined, see run.vars sample below and
On a Synology Diskstation you may use the Docker Gui instead of the following commands

docker pull tommi2day/bareos-mysql
docker run --name bareos-mysql \
--add-host bareos: \
--add-host ntp: \
-e TZ=$TZ \
-v ${BACKUP_DIR}:/backup \
-v ${SHARED_DIR}/db:/db \
-v ${SHARED_DIR}/etc-bareos:/etc/bareos \
-v ${SHARED_DIR}/log-mysql:/var/log/mysql \
-v ${SHARED_DIR}/log-bareos:/var/log/bareos \
-v ${SHARED_DIR}/etc-bareos-webui:/etc/bareos-webui \
-v ${SHARED_DIR}/log-apache2:/var/log/apache2 \
-p ${EXT_DIR_PORT}:9101 -p ${EXT_FD_PORT}:9102 -p ${EXT_SD_PORT}:9103 \
-p ${EXT_DB_PORT}:3306 -p ${EXT_HTML_PORT}:80

Bareos Gui Access


local settings

  • bareos.env --> will be sourced each time container starts.
    You may place your mailconfig or others there, with is not persistent in the container. Put this file into your shared /etc/bareos folder
#bareos env system configuration
#will be executed on every start by
#put your local system changes here
postconf -e relayhost=mailhost
postconf -e myhostname=bareos
echo "
" >>/etc/aliases
postfix restart

echo "Europe/Berlin" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
ntpdate -q
  • run.vars --> defines variables used by Put this file into the same path,
    if you want to use this commandline script.
    #shared folder on a synology nas
    #runtime variables

    exposed Ports

    # web, director, fd, storage, mysql daemons 
    EXPOSE 80 9101 9102 9103 3306


    VOLUME /db # mysql datadir
    VOLUME /var/log/mysql # mysql logfiles
    VOLUME /var/log/apache2 # apache logfiles
    VOLUME /backup # Backup Storage
    VOLUME ["/etc/bareos","/var/log/bareos","/etc/bareos-webui"] # Bareos konfiguration

    Environment variables used

    TARGET_HOST # Host/IP for bareos dir, fd and sd Address configuration parameter  
    BAREOS_DB_PASSWORD # create bareos user account with this password
    DB_ROOT_PASSWORD # create database with this password
    TZ #valid time zone name for /usr/share/zoneinfo

Attention: Update to Bareos 16.2 from previous versions

In Bareos 16.2 the configuration file structure has been changed. Additional a database schema update is requested.
See the documentation for details.
Make sure you have a backup of your configuration files and the mysql database (e.g. mysqldump ...)

If at the start of the container a file "/etc/bareos/bareos-dir.conf" is detected
it suspects an update to the new version is needed. It executes the supplied upgrade-database-script and tries to convert the existing configuration using
the downloaded script. This script extracts the configs
with bconsole commands und builds new config files only based on the extracted config,
not on the existing config files. As of Bareos 16.2.4 this method is known to produce invalid
configuration files, wich prevents the director to come up.

To solve these errors you may connect to the container using

 docker exec -ti bareos-mysql bash

or stop the container fix the issues in the shared configuration directory and start again.

Docker Pull Command
Source Repository