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.

相关推荐
带娃的IT创业者9 分钟前
Claude Code Routines 深度解析:重新定义 AI 辅助编程的工作流自动化
运维·人工智能·自动化·ai编程·工作流·anthropic·claude code
broadview_java13 分钟前
搬瓦工修改SSH端口
运维·网络·ssh
嵌入式×边缘AI:打怪升级日志29 分钟前
从硬编码按键驱动到 Linux Platform 设备树驱动:逐行解剖与融会贯通
linux·运维·服务器
小周技术驿站1 小时前
Linux 权限管理细节详解
linux·运维·服务器·ubuntu·centos
雨奔1 小时前
Kubernetes 网络策略(NetworkPolicy)完全指南:声明式 Pod 通信管控
网络·容器·kubernetes
身如柳絮随风扬2 小时前
Kubernetes v1.20.9 集群搭建
云原生·容器·kubernetes
senijusene2 小时前
I2C 总线框架下LM75A 温度传感器 Linux驱动开发:
linux·运维·驱动开发
专注VB编程开发20年2 小时前
工控成套控制柜厂家 / 自动化小工厂 对外市场价
运维·自动化·工控·上位机开发
microxiaoxiao2 小时前
Aeroshell:2026 年,支持AI的SSH 终端
运维·人工智能·ssh
feng14562 小时前
稳定性-风险文化建设和风险意识培养
运维·人工智能