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.

相关推荐
乔旭伟8 小时前
部署形态选型笔记:多租户 SaaS 与单机本地部署的运维模型对比
运维·服务器·1024程序员节
姜鱼问生9 小时前
大屏突然 502?一次 Nginx Buffer 溢出引发的血案:upstream sent too big header
运维
深圳市恒星物联科技有限公司9 小时前
排水管网监测后期运维成本高吗?成本构成与控制策略分析
运维·缓存
TTATTC10 小时前
为什么 Python 做 Agent 总在并发中崩溃?拆解 Blockcell 在 Rust 下的 Host-Cell 隔离与自愈状态机
docker·开源
AIex-YH10 小时前
发酵罐里点一盏灯:光发酵,正在重算微藻蛋白的成本账
运维·制造·策略模式
jimmyleeee11 小时前
Agent安全之一:Agent Goal Hijack(ASI01)----当智能体“正确地”执行了错误的目标
运维·网络·安全
啊哈一半醒12 小时前
Redis 三大缓存问题:缓存穿透、缓存击穿、缓存雪崩
运维·redis·1024程序员节
fb_1234512 小时前
K8s存储与配置核心实战
云原生·容器·kubernetes
长不大的杨瑞杰12 小时前
OpenCode v2 CI 与自动化实战:无交互运行、权限收口与制品闭环
运维·人工智能·ci/cd·自动化·软件工程·1024程序员节
kaixin_learn_qt_ing12 小时前
Jenkins
运维·jenkins