Install postgresal with docker

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.

相关推荐
硅基手札2 分钟前
【linux内核专栏 08】时间与定时器
linux·运维·服务器
想做小南娘,发现自己是女生喵20 分钟前
Linux之Ubuntu入门篇知识总结
linux·运维·服务器
帷幕落秋1 小时前
Redis哨兵模式
运维·数据库
吴声子夜歌2 小时前
Nginx应用与运维——Nginx编译及部署(部署)
java·运维·nginx
帷幕落秋2 小时前
Redis主从复制
运维·数据库
帷幕落秋2 小时前
Mysql主从复制
运维·数据库
暖核3 小时前
MySQL 高级运维核心:备份恢复、主从复制与 MHA 高可用复习总结
运维·数据库·mysql
jackletter3 小时前
linux:systemd之守护进程
linux·运维·服务器·systemd
Ruiery4 小时前
Linux 6.6内核 CPU 深度解析(五):CPU 空闲状态机 cpuidle
linux·运维·服务器
XS0301064 小时前
Nginx 学习指南
运维·nginx