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.

相关推荐
夜影风3 小时前
Linux系统中自签名HTTPS证书
linux·运维·https
wb1893 小时前
流编辑器sed
运维·笔记·ubuntu·云计算
成工小白4 小时前
【Linux】C语言模拟实现shell命令行(程序替换原理)
linux·运维·服务器
hackchen4 小时前
NexusTerminal一款视频移动端的webSSH
docker·云原生·eureka·web-ssh
福理原乡大王5 小时前
Linux信号详解
linux·运维·服务器·c++·ubuntu·信号处理
孙克旭_6 小时前
day031-Shell自动化编程-数组与案例
linux·运维·自动化
喜欢踢足球的老罗6 小时前
自动化模型管理:MediaPipe Android SDK 中的模型文件下载与加载机制
android·运维·自动化
遇见火星6 小时前
自动化KVM虚拟机创建脚本详解:从模板到高效部署的线上实践!
运维·自动化·kvm
火山引擎开发者社区6 小时前
TickIt:基于 LLM 的自动化 Oncall 升级
运维·自动化·火山引擎
자신을 변화시키다7 小时前
磁盘配额管理
linux·运维·服务器·ubuntu·磁盘管理