{"id":18941391,"url":"https://github.com/kidk/docoba","last_synced_at":"2025-04-15T20:31:55.109Z","repository":{"id":136808959,"uuid":"122742954","full_name":"kidk/docoba","owner":"kidk","description":"Docoba is a label based Docker backup system.","archived":false,"fork":false,"pushed_at":"2019-09-06T17:43:18.000Z","size":13,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T02:11:04.944Z","etag":null,"topics":["automation","backup-script","docker","docker-image"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kidk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-24T13:30:27.000Z","updated_at":"2024-04-10T12:09:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d692feb-4ba8-45cf-b1e2-45938756b45e","html_url":"https://github.com/kidk/docoba","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kidk%2Fdocoba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kidk%2Fdocoba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kidk%2Fdocoba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kidk%2Fdocoba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kidk","download_url":"https://codeload.github.com/kidk/docoba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249148003,"owners_count":21220459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","backup-script","docker","docker-image"],"created_at":"2024-11-08T12:27:50.354Z","updated_at":"2025-04-15T20:31:55.086Z","avatar_url":"https://github.com/kidk.png","language":"Shell","readme":"# Docoba\n\n[![](https://images.microbadger.com/badges/version/kidk/docoba:1.0.0.svg)](https://microbadger.com/images/kidk/docoba:1.0.0 \"Get your own version badge on microbadger.com\")[![](https://images.microbadger.com/badges/image/kidk/docoba:1.0.0.svg)](https://microbadger.com/images/kidk/docoba:1.0.0 \"Get your own image badge on microbadger.com\")\n\nA label based backup system for containers. By defining labels at runtime or in Docker compose you can automatically backup containers and store on a remote location.\n\nAt the moment it's possible to backup Docker volumes and MySQL databases, but other integrations can easily be added. Backups can be stored remotely on Amazon S3.\n\n## How to use\n\n```\ndocker run -v /var/run/docker.sock:/var/run/docker.sock -v /:/host/:ro --env-file .backup-env kidk/docoba:latest\n```\n\n`.backup-env` contains all the environment variables needed for accessing S3.\n\n```\n# Credentials for AWS CLI tool\nAWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY=\nAWS_DEFAULT_REGION=eu-west-1\nAWS_S3_BUCKET=name-of-bucket\n\n# Optional host filesystem backup\nFILESYSTEM_BACKUP=/mnt/files/:/home\n```\n\n## Configuration\n\n### Host\n\nTo flag part of the host filesystem for backup, use the environment variable FILESYSTEM_BACKUP in `.backup-env`. The value is a colon delimited list of directories you want to backup. Use absolute path, so `/var/log/` and not `../var/log`.\n\n### Containers\n\nTo flag a container for backup, use the following labels.\n\n#### `VOLUME_BACKUP=\"volume1,volume2\"`\n\nThe value is a comma delimited list of volumes you want to backup. The label keeps into account the project used (through docker-compose).\n\nIt is technically possible to backup volumes not linked to the container with the label. This has limitations and should be avoided when possible. \n\n#### `MYSQL_BACKUP=true`\n\nDocoba will try to backup the MySQL container using the available credentials.\n\nIt looks for the following environment variables (in order) to connect:\n- `root` -\u003e `$MYSQL_ROOT_PASSWORD`\n- `root` -\u003e `MYSQL_RANDOM_ROOT_PASSWORD` (retrieves it from Docker logs)\n- `MYSQL_USERNAME` -\u003e `MYSQL_PASSWORD`\n\nIt will download all tables it can access with exception of `information_schema`, `performance_schema` and `mysql`.\n\n## Example\n\n```\nversion: '3'\n\nservices:\n  wordpress:\n    image: wordpress\n    restart: always\n    volumes:\n    - wordpress_ps:/var/www/html/wp-content\n    labels:\n      VOLUME_BACKUP: \"wordpress_ps\"\n    environment:\n      WORDPRESS_DB_HOST: \"mysql\"\n      WORDPRESS_DB_USER: \"username\"\n      WORDPRESS_DB_PASSWORD: \"password\"\n      WORDPRESS_DB_NAME: \"database\"\n\n  mysql:\n    image: mysql:5\n    restart: always\n    volumes:\n      - database_ps:/var/lib/mysql\n    environment:\n      MYSQL_ROOT_PASSWORD: \"super_secret_no_share_plz\"\n      MYSQL_DATABASE: database\n      MYSQL_USER: username\n      MYSQL_PASSWORD: password\n    labels:\n      MYSQL_BACKUP: \"true\"\n\nvolumes:\n  wordpress_ps:\n  database_ps:\n```\n\n## Development and testing\n\nThe scripts are written in Bash and are extensively commented. Feel free to provide pull requests, feature requests and bugs as they are much appreciated.\n\nYou can use the files in `test/` to run a local dev version of the scripts. Don't run the scripts directly on your machine as it may have unexpected results. Use `docker-compose up` to run a couple of test containers.\n\n## MIT License\n\nCopyright (c) 2018 Docoba\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkidk%2Fdocoba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkidk%2Fdocoba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkidk%2Fdocoba/lists"}