https://github.com/fixate/docker-postgres
Postgres docker image
https://github.com/fixate/docker-postgres
Last synced: 2 months ago
JSON representation
Postgres docker image
- Host: GitHub
- URL: https://github.com/fixate/docker-postgres
- Owner: fixate
- Created: 2014-01-24T08:36:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-18T11:14:54.000Z (over 9 years ago)
- Last Synced: 2025-01-04T08:37:20.536Z (4 months ago)
- Language: Shell
- Size: 246 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerfile for Postgres 9.3 on Ubuntu 14.04 (TAGS: 9.3)
[Docker index](https://index.docker.io/u/fixate/postgres/)
**Notes:**
- Creates a superuser called `docker` with password 'password'.
- Postgres data is decoupled from the image in a `/data` volume.### Next steps
To run from docker index:
```shell
First run:
$ CONTAINER=$(docker run -d \
--name postgres \
-p 5432 \
-v="/var/postgresql/data:/var/postgresql/data:rw" \
-v="/var/postgresql/logs:/var/postgresql/logs:rw" \
-e PGDATA=/var/postgresql/data -d "fixate/postgresql:9.3-1")
Start up:
$ CONTAINER=$(docker start postgres)
Get the IP:
$ IP=$(docker inspect -format='{{ .NetworkSettings.IPAddress }}' $CONTAINER )
```Access the database in a container:
```shell
# Check if running and get the port
docker ps
# Connect using IP
$ psql -U docker -h $IP -p [your port] template1
(password: password)
```