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.

相关推荐
志栋智能29 分钟前
小步快跑:从单一场景开启超自动化巡检之旅
运维·网络·人工智能·自动化
AugustRed44 分钟前
Linux 运维常用命令大全(超全速查表)
运维·网络·php
qq_452396231 小时前
第十篇:《Dockerfile 最佳实践与镜像瘦身》
docker
Plastic garden1 小时前
Docker(1)
运维·docker·容器
s_w.h1 小时前
【 linux 】动静态库的制作
linux·运维·服务器·算法·bash
songjxin1 小时前
Nginx 日志分析可视化面板
运维·nginx
专注VB编程开发20年2 小时前
安卓APP与服务器通讯技术,文件传输和文字消息收发
运维·服务器
gs801402 小时前
网络隐形杀手:从 Could not connect to SMTP host 报错深度剖析 Docker MTU 黑洞理论与实战
网络·docker·容器
Agent手记2 小时前
电信运营商如何用AI实现携号转网自动处理?基于实在Agent的业务自动化落地与TARS大模型解析方案
运维·人工智能·ai·自动化
wanhengidc2 小时前
云手机搬砖 像僵尸开炮
运维·网络·智能手机·云计算