{"id":48991499,"url":"https://github.com/bueti/bocker","last_synced_at":"2026-04-18T14:17:43.370Z","repository":{"id":65704511,"uuid":"594821565","full_name":"bueti/bocker","owner":"bueti","description":"CLI to backup Postgresql to a Docker image","archived":false,"fork":false,"pushed_at":"2025-02-27T18:54:09.000Z","size":374,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T02:58:00.458Z","etag":null,"topics":["docker","golang","postgresql"],"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/bueti.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":"2023-01-29T18:37:24.000Z","updated_at":"2025-02-27T19:12:34.000Z","dependencies_parsed_at":"2023-02-19T01:01:28.747Z","dependency_job_id":"f8536a84-832b-4e42-8605-920260f1a6be","html_url":"https://github.com/bueti/bocker","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/bueti/bocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueti%2Fbocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueti%2Fbocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueti%2Fbocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueti%2Fbocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bueti","download_url":"https://codeload.github.com/bueti/bocker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bueti%2Fbocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["docker","golang","postgresql"],"created_at":"2026-04-18T14:17:40.331Z","updated_at":"2026-04-18T14:17:43.360Z","avatar_url":"https://github.com/bueti.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backup and Restore in Docker (BockeR)\n\n\u003e [!NOTE]\n\u003e With the latest pricing and subscription changes by Docker there's no longer unlimited free storage and thus this project is kinda pointless.\n\u003e You should probably just upload your backup on an S3(-compatible) bucket :)\n\n## Overview\n\u003cimg align=\"right\" src=\"https://github.com/bueti/bocker/assets/383917/98d90d7a-38fa-4df4-90c3-3b9bd345c9af\"\u003e\n\nHave you ever looked for a cheap solution to store a database backup somewhere safe and you didn't want to bother with an S3-compatible cloud storage?\n\nLook no further, because there is **BockeR**.  \n\nBockeR is a command line tool which creates a backup from a PostgreSQL database, wraps it in a Docker image, and uploads it to Docker Hub. Of course, BockeR will also do the reverse and restore your database from a backup in Docker Hub.\n\n\nIs it a good idea? Probably not, but it solved a problem I had!\n\n\n\u003e [!WARNING]\n\u003e Do **not** push the image to a public repository, or everybody in the world will have access to your database backup!\n\n## Installation\n\n### Homebrew\n\nLinux and macOS binaries are available in Homebrew:\n\n```sh\nbrew install bueti/tap/bocker\n```\n\nOr `brew tap bueti/tap` and then `brew install bocker`.\n\n### Manual\n\nDownload the appropriate file from the [Releases](https://github.com/bueti/bocker/releases) page, unpack the file and put the binary in your PATH.\n\n## Usage\n\n### Configuration\n\nTo configure your username and password run:\n```sh\nbocker config set\n```\n\nIf you want to run bocker on server where there's no keyring tool installed, set the following environment variables:\n\n```sh\nexport DOCKER_USERNAME=\u003cyour docker username\u003e\nexport DOCKER_PASSWORD=\u003cyour docker password\u003e\n```\n\n`bocker` will prefer environment variables over the keyring.\n\n![bocker config](https://vhs.charm.sh/vhs-6w65TVtSWeJqk5oGv5N9cp.gif)\n\n### List existing backups\n\nTo list existing backups you need to tell bocker for which namespace and repository you want to list tags:\n\n```sh\nbocker backup list -n \u003cnamespace\u003e -r \u003crepository\u003e\n```\n\n![bocker backup list](https://vhs.charm.sh/vhs-3LVSVJ42TqACEBIIGcRR4g.gif)\n\n### Restore backup\n\nTo restore a database you'll need supply a few parameters:\n```shell\n$ bocker restore -h\n\nRestores a Postgres database\n\nUsage:\n  bocker restore [flags]\n\nFlags:\n  -c, --container-id string   ID of container running PostgreSQL\n      --db-host string        Hostname of the database host (default \"localhost\")\n  -o, --db-owner string       Database user\n  -s, --db-source string      Source database name\n  -t, --db-target string      Target database name\n  -h, --help                  help for restore\n      --import-roles          Create roles from backup\n  -n, --namespace string      Docker Namespace (default \"bueti\")\n  -r, --repository string     Docker Repository\n      --tag string            Tag of the image with the backup in it\n```\n\n```sh\nbocker restore -r greenlight_backup -o postgres -s greenlight -t greenlight_test --tag 2023-02-14_21-11-43\n```\n![Made with VHS](https://vhs.charm.sh/vhs-3tyELWQdiy2wxPcDn1391H.gif)\n\n### More\nThere are some assumptions made:\n\n- The host you are running `bocker` has Docker installed\n- `docker login` was run successfully and you must have permission to push images\n- You need a Docker Hub Personal Access Token which requires the following permissions: `Read, Write, Delete`\n\nUse `-h` to get help for each subcommand:\n\n```sh\n$ bocker --help\nBocker is a command line tool which creates a backup from a PostgreSQL database, \nwraps it in a Docker image, and uploads it to Docker Hub.  Of course, Bocker will also do the \nreverse and restore your database from a backup in Docker Hub.\n\nUsage:\n  bocker [command]\n\nAvailable Commands:\n  backup      Backup a Postgresql Database\n  completion  Generate the autocompletion script for the specified shell\n  help        Help about any command\n  restore     Restores a Posgres database\n\nFlags:\n  -h, --help                help for bocker\n  -n, --namespace string    Docker Namespace (default \"bueti\")\n  -r, --repository string   Docker Repository\n\nUse \"bocker [command] --help\" for more information about a command.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbueti%2Fbocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbueti%2Fbocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbueti%2Fbocker/lists"}