Intall postgresql with docker in China
-
- [1.Show the images of docker](#1.Show the images of docker)
- [2.Create the image of postgresql](#2.Create the image of postgresql)
- [3.Connect the database in container](#3.Connect the database in container)
- [4.Connect the postgre with remote tool](#4.Connect the postgre with remote tool)
1.Show the images of docker
shell
docker ps
Attention:
If you do not choose the version, docker will pull the latest version application!
shell
docker pull postgres
2.Create the image of postgresql
shell
docker run -it \
--name postgres \
--privileged \
-e POSTGRES_PASSWORD=demo \
-p 5432:5432 \
-v /usr/local/software/postgres/data:/var/lib/postgresql/data \
-d postgres
3.Connect the database in container
shell
docker exec -it postgres /bin/bash
4.Connect the postgre with remote tool
We choose the DBeaver to connect the postgreSql.
we already connected the database.