{"id":13509796,"url":"https://github.com/muesli/docker-backup","last_synced_at":"2025-04-06T10:13:29.234Z","repository":{"id":35209511,"uuid":"184776583","full_name":"muesli/docker-backup","owner":"muesli","description":"A tool to create \u0026 restore complete, self-contained backups of Docker containers","archived":false,"fork":false,"pushed_at":"2023-05-11T20:38:54.000Z","size":74,"stargazers_count":344,"open_issues_count":28,"forks_count":42,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T09:08:49.081Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","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/muesli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"muesli"}},"created_at":"2019-05-03T15:11:07.000Z","updated_at":"2025-03-28T19:04:59.000Z","dependencies_parsed_at":"2024-01-13T19:24:36.879Z","dependency_job_id":null,"html_url":"https://github.com/muesli/docker-backup","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.16216216216216217","last_synced_commit":"4fc51eee0e1f78de8d0757dc03ed5de544f14277"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fdocker-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fdocker-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fdocker-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muesli%2Fdocker-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muesli","download_url":"https://codeload.github.com/muesli/docker-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464223,"owners_count":20942970,"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":["hacktoberfest"],"created_at":"2024-08-01T02:01:13.347Z","updated_at":"2025-04-06T10:13:29.205Z","avatar_url":"https://github.com/muesli.png","language":"Go","funding_links":["https://github.com/sponsors/muesli"],"categories":["Go","hacktoberfest"],"sub_categories":[],"readme":"docker-backup\n=============\n\n[![Latest Release](https://img.shields.io/github/release/muesli/docker-backup.svg)](https://github.com/muesli/docker-backup/releases)\n[![Build Status](https://github.com/muesli/docker-backup/workflows/build/badge.svg)](https://github.com/muesli/docker-backup/actions)\n[![Go ReportCard](https://goreportcard.com/badge/muesli/docker-backup)](https://goreportcard.com/report/muesli/docker-backup)\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://pkg.go.dev/github.com/muesli/docker-backup)\n\nA tool to create \u0026 restore complete, self-contained backups of Docker containers\n\n# What's the issue\n\nDocker services usually have a bunch of volatile data volumes that need to be\nbacked up. Backing up an entire (file)system is easy, but often enough you just\nwant to create a backup of a single (or a few) containers, maybe to restore them\non another system later.\n\nSome services, such as databases, also need to be aware (flushed/synced/paused)\nof an impending backup. The backup should be run on the Docker host, as you\ndon't want to have a backup client configured \u0026 running in every single\ncontainer either, since this would add a lot of maintenance \u0026 administration\noverhead.\n\n`docker-backup` directly connects to Docker, analyzes a container's mounts \u0026\nvolumes, and generates a list of dirs \u0026 files that need to be backed up on the\nhost system. This also collects all the metadata information associated with a\ncontainer, so it can be restored or cloned on a different host, including its\nport-mappings and data volumes.\n\nThe generated list can either be fed to an existing backup solution or\n`docker-backup` can directly create a `.tar` image of your container, so you can\nsimply copy it to another machine.\n\n## Installation\n\n`docker-backup` requires Go 1.11 or higher. Make sure you have a working Go\nenvironment. See the [install instructions](https://golang.org/doc/install.html).\n\n`docker-backup` works with Docker hosts running Docker 18.02 (API version 1.36)\nand newer.\n\n### Packages\n\n- Arch Linux: [docker-backup](https://aur.archlinux.org/packages/docker-backup/)\n\n### From source\n\n    git clone https://github.com/muesli/docker-backup.git\n    cd docker-backup\n    go build\n\nRun `docker-backup --help` to see a full list of options.\n\n## Usage\n\n### Creating a Backup\n\nTo backup a single container start `docker-backup` with the `backup` command and\nsupply the ID of the container:\n\n    docker-backup backup \u003ccontainer ID\u003e\n\nThis will create a `.json` file with the container's metadata, as well as a file\ncontaining all the volumes that need to be backed up with an external tool like\n[restic](https://restic.net/) or [borgbackup](https://www.borgbackup.org/).\n\nIf you want to directly create a `.tar` file containing all the container's\ndata, simply run:\n\n    docker-backup backup --tar \u003ccontainer ID\u003e\n\nYou can also backup all running containers on the host with the `--all` flag:\n\n    docker-backup backup --all\n\nTo backup all containers (regardless of their current running state), run:\n\n    docker-backup backup --all --stopped\n\nWith the help of `--launch` you can directly launch a backup program with the\ngenerated file-list supplied as an argument:\n\n    docker-backup backup --all --launch \"restic -r /dest backup --password-file pwfile --tag %tag --files-from %list\"\n\n### Restoring a Backup\n\nTo restore a container, run `docker-backup` with the `restore` command:\n\n    docker-backup restore \u003cbackup file\u003e\n\n`docker-backup` will automatically detect whether you supplied a `.tar` or\n`.json` file and restore the container, including all its port-mappings and data\nvolumes.\n\nIf you want to start the container once the restore has finished, add the\n`--start` flag:\n\n    docker-backup restore --start \u003cbackup file\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuesli%2Fdocker-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuesli%2Fdocker-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuesli%2Fdocker-backup/lists"}