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.

相关推荐
Luminbox紫创测控12 分钟前
氙灯太阳光模拟器如何获得AM 1.5G标准太阳光谱?
运维·人工智能·5g
运维行者_13 分钟前
通过 OpManager 集成 Firewall Analyzer 插件,释放统一网络管理与安全的强大能力
大数据·运维·服务器·网络·数据库·安全
腾讯蓝鲸智云28 分钟前
【运维自动化-节点管理】节点管理有哪些插件?如何安装插件?
运维·服务器·自动化·云计算·sass·paas
何中应32 分钟前
Grafana列表如何设置固定排序
运维·数据分析·grafana
天草二十六_简村人39 分钟前
阿里云SLS采集jvm日志(上)
java·运维·数据库·后端·阿里云·容器·云计算
姚永强43 分钟前
lvm知识点(带部分实验)
运维
码农多耕地呗43 分钟前
VMware创建虚拟机
linux·运维·服务器
winfreedoms44 分钟前
宿主机有网、Docker 容器不能解析域名?用 daemon.json 一键配置永久 DNS
运维·docker·容器·json
代码栈上的思考1 小时前
消息队列 BrokerServer 核心逻辑:processConnection 与请求处理全解析
运维·服务器
youyudexiaowangzi1 小时前
ubuntu 1604安装组件报错
linux·运维·ubuntu