Ubuntu-based Bucardo image for Docker Containers.
1.3K
This repository provides a Docker image for Bucardo, a powerful asynchronous multi-master replication system for PostgreSQL. The image is based on Ubuntu and is automatically built and published to Docker Hub.
GitHub: weverkley/bucardo_docker_image
bucardo.json)docker rundocker-composedatabases objectsyncs objectbucardo.json file.herd) or specify a list of tables (tables).bucardo.json)First, create a bucardo.json configuration file. The container will mount and read this file on startup.
{
"databases":[
{
"id": 3,
"dbname": "example_db",
"host": "host0.example.com",
"user": "example_user",
"pass": "secret",
"port": 5432
},{
"id": 1,
"dbname": "example_db",
"host": "host1.example.com",
"user": "example_user",
"pass": "secret",
"port": 5432
},{
"id": 2,
"dbname": "example_db",
"host": "host3.example.com",
"user": "example_user",
"pass": "secret",
"port": 5432
}],
"syncs" : [
{
"sources": [3],
"targets": [1,2],
"herd": "all_from_source",
"onetimecopy": 1
},{
"sources": [1,2],
"targets": [3],
"tables": "product, order",
"onetimecopy": 0
}
]
}
Inside databases, describe all databases you desire to sync as a source and/or as a target;
The ID attribute must be a unique integer per database, and has nothing to do your database but the way the container will identify it;
Once your databases are described, you must describe your syncs;
Each sync must have one or more sources, and one or more targets; and these have to be described following JSON standard Array notation;
Each entity inside the sources and targets arrays represents an ID referring to the databases described beforehand;
You must define what to sync. You can either use herd or tables:
herd: Provide a string with a name for the herd. All tables from the first source database will be added to this herd and synchronized.tables: A string containing a comma-separated list of tables to be synchronized.Onetimecopy is used for full table copy:
docker run --name my_own_bucardo_container \
-v <bucardo.json dir>:/media/bucardo \
-d weverkley/bucardo
docker logs my_own_bucardo_container -f
Same as before. The only difference is:
In the JSON database definition, type "env" for password instead of the database user password;
When you create a container, inform the password as a environment variable named BUCARDO_DB, where ID is the ID you defined earlier in the bucardo.json:
docker run --name my_own_bucardo_container \
-v <bucardo.json dir>:/media/bucardo \
-e BUCARDO_DB3="secret" \
-d weverkley/bucardo
This image uses the following software components:
This project is copyright 2025 Wever Kley [email protected].
Licensed under Apache 2.0 License.
Check the license file for details.
Content type
Image
Digest
sha256:4ffc6b485…
Size
259.7 MB
Last updated
11 months ago
docker pull weverkley/bucardo