{"id":20850470,"url":"https://github.com/noteed/docker-postgresql","last_synced_at":"2026-04-24T06:32:45.245Z","repository":{"id":12836213,"uuid":"15511690","full_name":"noteed/docker-postgresql","owner":"noteed","description":"Assorted Docker images with PostgreSQL","archived":false,"fork":false,"pushed_at":"2015-01-30T09:52:54.000Z","size":208,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T12:33:11.695Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noteed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-29T17:00:51.000Z","updated_at":"2018-08-18T13:49:07.000Z","dependencies_parsed_at":"2022-08-30T11:30:13.062Z","dependency_job_id":null,"html_url":"https://github.com/noteed/docker-postgresql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noteed/docker-postgresql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fdocker-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fdocker-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fdocker-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fdocker-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noteed","download_url":"https://codeload.github.com/noteed/docker-postgresql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fdocker-postgresql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28047377,"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-12-26T02:00:06.189Z","response_time":55,"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":[],"created_at":"2024-11-18T03:09:41.262Z","updated_at":"2025-12-26T06:37:26.264Z","avatar_url":"https://github.com/noteed.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker images with PostgreSQL\n\n## `pgserver`\n\n`pgserver` is the base server image. It is basically `apt-get install\npostgresql-9.1`, with a \"docker\" user, and a \"docker\" database already created.\n\nThe following command can be used to build the image:\n\n    \u003e docker build -t pgserver pgserver\n\nThe image provides five commands:\n\n- `configure`,\n- `build`,\n- `run`,\n- `restore`\n- and `psql`.\n\n`configure` takes three arguments: a new database name, a username, and a\npassword. Once the container exits, you can commit it to a new image.\n\n    \u003e docker run pgserver configure \u003cdatabase\u003e \u003cuser\u003e \u003cpassword\u003e\n    \u003e docker commit `docker ps -l -q` \u003cimage\u003e\n\n`restore` is used to temporarily restore a database cluster dump and inspect it\nwith `psql`. Assuming the file to restore and inspect is in the current\ndirectory:\n\n    \u003e docker run -t -i -v `pwd`:/in pgserver restore /in/\u003cfilename\u003e\n\n`run` simply starts the PostgreSQL server. See `pgserver.sh` for an example\nthat use the `run` command then spawn a local `psql` process to connect to the\nserver. `psql` directly starts a `psql` process within the container.\n\n    \u003e docker run -d pgserver run\n    \u003e docker run -t -i pgserver psql\n\nIf a file `/initial.sh` is available in the image, it is executed before\nrunning the server. Its purpose is to provide another way to create the `/data`\ndirectory. A second argument can be given and will be passed the script (e.g.\nto give it some URL from which to fetch a tarball).\n\n    \u003e docker run -d pgserver run http://example.com/base.tar.gz\n\nTo keep the PostgreSQL cluster around, and possibly reuse it in the next run of\nthe image, a volume called `/data` can be given to the container, e.g.:\n\n    \u003e docker run -t -i -v `pwd`/data:/data pgserver psql\n\nWhen the container sees a `/data` directory, it will use it instead of the\ncluster that already exists within the image.\n\nOne possible way to create initially the local `data` directory is to use\n`docker cp`, e.g.:\n\n    \u003e docker run pgserver true\n    \u003e docker cp `docker ps -l -q`:/var/lib/postgresql/9.1/main .\n    \u003e mv main data\n\nwhere `a62681994e1f` is the container ID of a previous run.\n\n    \u003e docker run pgserver\n    \u003e docker ps -l\n\nA complementary way to create the local `data` is to provide a `build.sh`\nscript and use the `build` command:\n\n    \u003e docker run -v `pwd`/build:/build pgserver build\n    \u003e docker cp `docker ps -l -q`:/var/lib/postgresql/9.1/main .\n    \u003e mv main data\n\nThis makes it possible to initialize the cluster in a clean way (i.e. the\nserver is stopped properly with `service postgresql stop`).\n\n# `pgprimary`\n\n`pgprimary` is similar to `pgserver` (and it is built on top of it), but has\nWAL archiving enabled. Read its Dockerfile to see how to configure a new\nimage for yourself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fdocker-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoteed%2Fdocker-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fdocker-postgresql/lists"}