|DockerHub|_
.. |DockerHub| image:: https://img.shields.io/badge/docker-swcc%2Fdocker--postgresql-blue.svg .. _DockerHub: https://registry.hub.docker.com/u/swcc/docker-postgresql/
A PostgreSQL database Dockerfile based on phusion/baseimage.
This image is available as a trusted build on the docker index. The easiest way to get it on your server is using docker pull:
.. code-block:: bash
$ docker pull swcc/docker-postgresql
Alternatively, you can clone this repository and build the image yourself:
.. code-block:: bash
$ docker build -t docker-postgresql .
Launch a container with this image (bind postgres port anywhere you want e.g. 49999):
.. code-block:: bash
$ docker run -p 127.0.0.1:49999:5432 swcc/docker-postgresql
Once you have started a container from this image, you can access it via:
.. code-block:: bash
# Use your container's name or id
$ docker exec -ti <container-name-or-id> su postgres -c 'psql'
Or can connect to the PostgreSQL database directly if you have the PostgreSQL client installed:
.. code-block:: bash
# Use your container's host and port
$ psql -U postgres -h 127.0.0.1 -p 49999
Learn more about Dockerfiles and how to build them in the Docker documentation: http://docs.docker.io/en/latest/reference/builder/
Content type
Image
Digest
sha256:8ea1fa705…
Size
129.5 MB
Last updated
almost 11 years ago
docker pull swcc/docker-postgresql