mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-06-27 22:52:13 +08:00
release 9.4
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
**latest**
|
||||
**9.4**
|
||||
- postgresql: upgrade to 9.4
|
||||
|
||||
**9.1-2**
|
||||
|
||||
@@ -58,7 +58,7 @@ In your issue report please make sure you provide the following information:
|
||||
Pull the latest version of the image from the docker index. This is the recommended method of installation as it is easier to update image in the future. These builds are performed by the **Docker Trusted Build** service.
|
||||
|
||||
```bash
|
||||
docker pull sameersbn/postgresql:9.1-2
|
||||
docker pull sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
Alternately you can build the image yourself.
|
||||
@@ -74,14 +74,14 @@ docker build -t="$USER/postgresql" .
|
||||
Run the postgresql image
|
||||
|
||||
```bash
|
||||
docker run --name postgresql -d sameersbn/postgresql:9.1-2
|
||||
docker run --name postgresql -d sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
The simplest way to login to the postgresql container as the administrative `postgres` user is to use the `--volumes-from` docker option to connect to the postgresql server over the unix socket.
|
||||
|
||||
```bash
|
||||
docker run -it --rm --volumes-from=postgresql \
|
||||
sameersbn/postgresql:9.1-2 sudo -u postgres -H psql
|
||||
sameersbn/postgresql:9.4 sudo -u postgres -H psql
|
||||
```
|
||||
|
||||
Alternately you can fetch the password set for the `postgres` user from the container logs.
|
||||
@@ -117,7 +117,7 @@ To create a new user you should specify the `DB_USER` and `DB_PASS` variables. T
|
||||
```bash
|
||||
docker run --name postgresql -d \
|
||||
-e 'DB_USER=dbuser' -e 'DB_PASS=dbpass' \
|
||||
sameersbn/postgresql:9.1-2
|
||||
sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
**NOTE**
|
||||
@@ -128,10 +128,10 @@ Similarly, you can also create a new database by specifying the database name in
|
||||
|
||||
```bash
|
||||
docker run --name postgresql -d \
|
||||
-e 'DB_NAME=dbname' sameersbn/postgresql:9.1-2
|
||||
-e 'DB_NAME=dbname' sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
You may also specify a comma separated list of database names in the `DB_NAME` variable. The following command creates two new databases named *dbname1* and *dbname2 (p.s. this feature is only available in releases greater than 9.1-2)*
|
||||
You may also specify a comma separated list of database names in the `DB_NAME` variable. The following command creates two new databases named *dbname1* and *dbname2 (p.s. this feature is only available in releases greater than 9.4)*
|
||||
|
||||
```bash
|
||||
docker run --name postgresql -d \
|
||||
@@ -145,7 +145,7 @@ For example,
|
||||
```bash
|
||||
docker run --name postgresql -d \
|
||||
-e 'DB_USER=dbuser' -e 'DB_PASS=dbpass' -e 'DB_NAME=dbname' \
|
||||
sameersbn/postgresql:9.1-2
|
||||
sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
, will create a user *dbuser* with the password *dbpass*. It will also create a database named *dbname* and the *dbuser* user will have full access to the *dbname* database.
|
||||
@@ -167,7 +167,7 @@ The updated run command looks like this.
|
||||
|
||||
```bash
|
||||
docker run --name postgresql -d \
|
||||
-v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:9.1-2
|
||||
-v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
This will make sure that the data stored in the database is not lost when the image is stopped and started again.
|
||||
@@ -229,11 +229,11 @@ docker stop postgresql
|
||||
- **Step 2**: Update the docker image.
|
||||
|
||||
```bash
|
||||
docker pull sameersbn/postgresql:9.1-2
|
||||
docker pull sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
- **Step 3**: Start the image
|
||||
|
||||
```bash
|
||||
docker run --name postgresql -d [OPTIONS] sameersbn/postgresql:9.1-2
|
||||
docker run --name postgresql -d [OPTIONS] sameersbn/postgresql:9.4
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user