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.

相关推荐
九硕智慧建筑一体化厂家9 小时前
数字化管控落地,直流照明构筑安全照明体系
运维·人工智能·笔记·安全·智慧城市
刘某的Cloud10 小时前
ceph osd 导入导出 rbd volume 卷
linux·运维·ceph·volume
QX_hao11 小时前
【Kubernetes】 的三个Probe
容器·kubernetes
神奇霸王龙12 小时前
Agent 准入门控屠夫:5 旗舰 4 维度评估
linux·运维·数据库·ai·ai作画·agent·ai编程
cfm_291413 小时前
基于Binlog实现不停机数据库平滑迁移技术
运维·数据库·架构
迪康Defender13 小时前
AI 重构终端安全运营:智能分析中枢 AI Insight 模块架构与落地场景深度解析
运维·网络·人工智能·其他·安全·重构·架构
HiDev_14 小时前
【非标自动化】2、认识元器件(固态继电器)
运维·自动化
明达智控技术15 小时前
国产 PLC 落地立库自动化,MC5000边缘智能控制器破局
运维·自动化
小绫网络安全15 小时前
Kali Linux渗透测试入门教程:从零搭建到实战攻防
linux·运维·服务器
allforgood15 小时前
控制启动过程
linux·运维·服务器