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.

相关推荐
时间的拾荒人1 小时前
Linux 系统命令与网络、磁盘、日志监控(下篇):性能原理与优化
linux·运维·网络
鹤落晴春6 小时前
MySQL日志梳理
运维·数据库·mysql
zly35008 小时前
esxi安装 windows2000 鼠标不动
运维·服务器
AR-26710-11 小时前
docker Day2——镜像 / 容器 / 仓库
运维·docker·容器
分布式存储与RustFS11 小时前
旧 ledger 堆满 Bookie 磁盘:用 Pulsar 分层存储把冷数据卸进 RustFS
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
Huangjin007_12 小时前
【Linux 系统篇(四十一)】线程(二):线程的优缺点、资源共享与上下文切换
linux·运维·服务器
好用斋12 小时前
拾光坞G2使用新版Docker懒人包:一键安装、一键升级、一键卸载
java·docker·容器
码云社区13 小时前
Spring Boot云快充协议源码:充电桩远程重启、参数配置与升级运维方案
运维·spring boot·后端·充电桩·充电系统·充电软件
csdn_aspnet13 小时前
生产环境中 SQL Server 的 Docker 使用建议
运维·microsoft·docker·容器·sqlserver
csdn_aspnet14 小时前
如何在 Docker 上安装 SQL Server
运维·microsoft·docker·容器·sqlserver