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.

相关推荐
Jay Kay7 分钟前
RDMA中CQ为什么用轮询?——从CQ、Doorbell到GID的深度解析
运维·服务器·网络
kruptos18 分钟前
嵌入式 Linux 驱动开发:第一个内核模块怎么写?
linux·运维·驱动开发·嵌入式硬件
wangqiaowq20 分钟前
langfuse linux下的安装部署
linux·运维·服务器
青禾83725 分钟前
Docker 从入门到实践:镜像、容器、数据卷与 Docker Compose
运维·docker·容器
xrlfreedom39 分钟前
大厂 MCP 面试实录:桌面客户端 stdio MCP Server 调试与安全加固方案设计
docker·结构化输出·mcp·提示注入防护
wdfk_prog43 分钟前
Docker 开发环境到底要交付什么:镜像、源码与运行脚本
运维·docker·容器
Huangjin007_44 分钟前
【Linux 系统篇(十七)】进程(五) :进程切换、O(1) 调度算法
linux·运维·服务器
weixin_464307631 小时前
linux虚拟机断网
linux·运维·服务器
志栋智能1 小时前
凌晨3点的告警,如何用AI在5分钟内完成定界?
运维·服务器·数据库·人工智能·自动化
一技安身1 小时前
【Docker】Docker 和 docker‑compose 的核心区别 + 为什么要单独装 compose
docker·容器·eureka