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.

相关推荐
济南java开发,求内推2 分钟前
docker 安装fastdfs
docker·fastdfs
2501_939909052 分钟前
自动化运维工具 Ansible 集中化管理服务器
运维·自动化·ansible
不爱吃糖的程序媛4 分钟前
OpenHarmony Linux 环境 SDK 使用说明(进阶--依赖库的解决方法)
linux·运维·harmonyos
Henry Zhu1235 分钟前
VPP中ACL源码详解第三篇:ACL是如何以统一的接口来为其他插件服务(上)
运维·服务器·网络
hanyi_qwe5 分钟前
自动化运维工具 Ansible 集中化管理服务器
运维·自动化·ansible
wayuncn8 分钟前
预算49800,99800,299800能买到什么样的算力服务器
运维·服务器·人工智能·算力一体机·ai算力服务器
Cat God 0078 分钟前
基于 Docker 部署 Kafka(KRaft + SASL/PLAIN 认证)
docker·容器·kafka
wanhengidc15 分钟前
云端虚拟 巨椰 云手机
运维·服务器·安全·智能手机·云计算
wanhengidc15 分钟前
云手机 互联网 云端科技
运维·服务器·科技·智能手机·云计算
XXYBMOOO17 分钟前
基于 HTML5 Canvas 的终端日志流可视化实现(支持多 Pane / 运维模式)
运维·前端·html5