{"id":19368474,"url":"https://github.com/anchore/engine-db-preload","last_synced_at":"2025-08-03T04:14:58.370Z","repository":{"id":33599525,"uuid":"150786494","full_name":"anchore/engine-db-preload","owner":"anchore","description":"Some scripting to handling creation of preloaded anchore DB container","archived":false,"fork":false,"pushed_at":"2022-08-02T20:16:12.000Z","size":167,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-01-06T22:35:33.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anchore.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}},"created_at":"2018-09-28T19:33:23.000Z","updated_at":"2022-03-29T17:18:50.000Z","dependencies_parsed_at":"2022-08-07T22:15:30.450Z","dependency_job_id":null,"html_url":"https://github.com/anchore/engine-db-preload","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-db-preload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-db-preload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-db-preload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fengine-db-preload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anchore","download_url":"https://codeload.github.com/anchore/engine-db-preload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240491823,"owners_count":19809977,"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":[],"created_at":"2024-11-10T08:06:41.737Z","updated_at":"2025-02-24T13:42:55.849Z","avatar_url":"https://github.com/anchore.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# engine-db-preload\nSome scripting to handling creation of preloaded anchore DB container\n\nThe purpose of this repo is to host scripts to coordinate the creation of pre-populated database containers for anchore-engine.\n\n1) set up a regular docker-compose-style setup for anchore-engine\n2) run the feed_sync_wait.py command from this repo.  The parameters are 'number of minutes to wait total for the check to complete' and 'interval between polling updates to see if feed sync is complete'.  In the following example, the values represent 'wait 30 minutes before bailing out, with 5 second intervals between polling attempts'.\n\n```\ncd ~/aevolume/\ndocker-compose up -d\n...\n/path/to/scripts/feed_sync_wait.py 30 5\n```\n\n3) if successful, the end of this run will look like:\n\n```\ngot container IDs: engine=ee40c64242830f4bd75be25a0b9a2c0e044bb2ce4ca95f69e8c7ccc672391326 db=96f50d2b33f175783e0893ed4b1b7f11614036b0f564dd4e441ef320cff52138\nengine not up yet - exception: ('Connection aborted.', error(104, 'Connection reset by peer'))\nengine not up yet - exception: ('Connection aborted.', error(104, 'Connection reset by peer'))\nengine not up yet - exception: ('Connection aborted.', error(104, 'Connection reset by peer'))\n...\n...\n...\nverified that anchore-engine is up and ready\n\nattempt 0 / 600\ngot last full sync time - good to go!: 2018-09-28T22:59:47.912693Z\nverified feed sync has completed\nCMD: ['docker-compose', 'stop', 'anchore-engine']\nStopping testtest_anchore-engine_1 ... \nStopping testtest_anchore-engine_1 ... done\n\tOUTPUT: \nCMD: ['docker-compose', 'exec', 'anchore-db', '/bin/bash', '-c', 'pg_dump -U postgres -Z 9 \u003e /docker-entrypoint-initdb.d/anchore-bootstrap.sql.gz']\n\tOUTPUT: \n\nCMD: ['docker-compose', 'stop']\nStopping testtest_anchore-db_1 ... done\n\tOUTPUT: \nCMD: ['docker', 'commit', '96f50d2b33f175783e0893ed4b1b7f11614036b0f564dd4e441ef320cff52138', 'anchore/engine-db-preload:latest']\n\tOUTPUT: sha256:3207abeeeb6cb25d6e06714c0d0ccca9eb1a4c18f5aed61486a8cbe6f3436faa\n\nCMD: ['docker-compose', 'down', '--volumes']\nRemoving testtest_anchore-engine_1 ... done\nRemoving testtest_anchore-db_1 ... done\nRemoving network testtest_default\n\tOUTPUT: \nSUCCESS: new prepopulated container image created: anchore/engine-db-preload:latest\n```\n\n4) the script will have brought down the anchore-engine/db containers, and will have created a new image tagged locally as 'anchore/engine-db-preload:latest'.  That image should now be able to be pushed to 'docker.io/anchore/engine-db-preload:latest' and used instead of a stock postgres:9 container for an anchore-engine DB.\n\nIf the script fails for any reason, it will bail with exit code 1, otherwise it will exit 0 on success.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fengine-db-preload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanchore%2Fengine-db-preload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fengine-db-preload/lists"}