{"id":21296893,"url":"https://github.com/reddec/dkp","last_synced_at":"2025-10-14T12:26:30.829Z","repository":{"id":223460377,"uuid":"760379681","full_name":"reddec/dkp","owner":"reddec","description":"DocKer compose Packer","archived":false,"fork":false,"pushed_at":"2024-05-04T12:24:07.000Z","size":23,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T05:05:42.733Z","etag":null,"topics":["backup-utility","docker-compose","python","sysadmin-tool"],"latest_commit_sha":null,"homepage":"","language":"Python","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/reddec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-20T10:05:20.000Z","updated_at":"2024-05-04T12:23:34.000Z","dependencies_parsed_at":"2024-05-04T13:33:55.098Z","dependency_job_id":null,"html_url":"https://github.com/reddec/dkp","commit_stats":null,"previous_names":["reddec/dkp"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/reddec/dkp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fdkp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fdkp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fdkp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fdkp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/dkp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fdkp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018751,"owners_count":26086576,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backup-utility","docker-compose","python","sysadmin-tool"],"created_at":"2024-11-21T14:30:35.863Z","updated_at":"2025-10-14T12:26:30.815Z","avatar_url":"https://github.com/reddec.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DKP - DocKer compose Packer\n\n[![PyPI - Version](https://img.shields.io/pypi/v/dkp)](https://pypi.org/project/dkp/)\n\nPacks existent docker-compose project in executable single encrypted (GPG\nAES256) archive (tar + gz). It means that you don't need to install DKP or\nremember procedure details during restore, which dramatically reduces stress and\nmake your life simpler. In the end - it's hard to remember how to restore backup\nmade by N generations of administrators years ago before you...\n\nThe pipeline is:\n\n```mermaid\nflowchart TD\n    A[tar volumes] --\u003eB(tar images)\n    B --\u003e C[add env files and manifests]\n    C --\u003e D[add restore scripts]\n    D --\u003e E[compress and encrypt]\n    E --\u003e F[wrap to self-extracting file]\n```\n\nFor backup you need:\n\n- gpg\n- python 3.8+ (see tests in workflow)\n- sh\n- tar\n- gzip\n- docker with compose plugin\n\nFor restore you need:\n\n- gpg\n- sed\n- tar\n- gzip\n\n## Installation\n\n**Recommended**\n\n    pip install dkp\n\nAlternative - just download [dkp/dkp.py](dkp/dkp.py) and make it executable.\n\n## Backward compatibility\n\nOnce backup created, the version of DKP doesn't matter anymore since archive is\nself-complete independent file.\n\nNew DKP versions may introduce more features as well as different layout of\nfinal archive, but it will not affect previous backups.\n\n## Usage\n\n### Create backup\n\n```\nusage: dkp [-h] [--output OUTPUT] [--skip-images] [--all-images]\n           [--passphrase PASSPHRASE] [--env-file [ENV_FILE ...]]\n           [project]\n\nDocker Compose packer - pack compose project with all batteries included\n\npositional arguments:\n  project               Compose project name. Default is docker-compose-pack\n\noptions:\n  -h, --help            show this help message and exit\n  --output OUTPUT, -o OUTPUT\n                        Output file. Default docker-compose-pack.bin\n  --skip-images, -S     Do not archive images\n  --all-images          Export all images. Without this option, only the\n                        images of those services are exported that have an\n                        'image' key in the compose file.\n  --passphrase PASSPHRASE, -p PASSPHRASE\n                        Passphrase to encrypt backup. Can be set via env\n                        PASSPHRASE\n  --env-file [ENV_FILE ...]\n                        Environment file(s) that should be passed to Compose\n                        with '--env-file'\n```\n\nCaveat: The `--env-file` option works according to the default behavior of the\n`argparse` module, not according to the Docker CLI conventions.\n\n1.  You should pass the `--env-file` option only once, and enumerate the files\n    afterwards (`--env-file env1 env2`). If you write `--env-file env1\n    --env-file env2`, the second option overwrites the first, and only `env2` is\n    used.\n\n2.  You can use `--` before the project name when you use `--env-file` before\n    it. This might be necessary because `--env-file env project` means that you\n    have two env files (one called `env` and the other called `project`).\n\n### Restore\n\n```\nUsage:\n\n./path/to/backup/file [--restore/-r] [-s/--start] [-h/--help] [passphrase]\n\n   passphrase      Key to decrypt archive. Can be set by env PASSPHRASE\n\n  -h, --help       Show this help\n  -r, --restore    Automatically restore project after unpacking\n  -s, --start      Automatically start project after unpacking. Implicitly enables --restore\n```\n\n## Troubleshooting\n\n# Error when restoring: \"gzip: stdin: not in gzip format\"\n\n*   Symptom: The following error is printed when trying to restore a pack.\n\n    ```\n    $ ./test.pack\n    unpacking to test-data\n\n    gzip: stdin: not in gzip format\n    tar: Child died with signal 13\n    tar: Error is not recoverable: exiting now\n    ```\n\n*   Reason: The pack is protected with a passphrase using GPG. Run the same pack\n    file with a passphrase:\n\n    ```\n    $ ./test.pack [passphrase]\n    ```\n\n    Or:\n\n    ```\n    $ PASSPHRASE=my_passphrase ./test.pack\n    ```\n\n# Error when restoring: \"gpg: no valid OpenPGP data found\"\n\n*   Symptom: The following error is printed when trying to restore a pack.\n\n    ```\n    $ ./test.pack my_passphrase\n    decrypting and unpacking to test-data\n    gpg: no valid OpenPGP data found.\n    gpg: decrypt_message failed: Unknown system error\n\n    gzip: stdin: unexpected end of file\n    tar: Child returned status 1\n    tar: Error is not recoverable: exiting now\n    ```\n\n*   Reason: The pack is *not* protected with a passphrase. Run the same pack\n    file without a passphrase, and ensure that the `PASSPHRASE` environment\n    variable is not set (or set to an empty string).\n\n    ```\n    $ ./test.pack\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fdkp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freddec%2Fdkp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freddec%2Fdkp/lists"}