Intall postgresql with docker in China
1.Show the images of docker
docker ps
Attention:
If you do not choose the version, docker will pull the latest version application!
docker pull postgres
2.Create the image of postgresql
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
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.