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.

相关推荐
Tokai_Teio_143 分钟前
第四届黄河流域 misc
运维·服务器
开发者联盟league1 小时前
使用k8s安装Sonarqube
云原生·容器·kubernetes
hj2862511 小时前
Linux 网络服务综合笔记(概念 + 命令 + 实操案例)2
linux·运维·网络
what_20181 小时前
Linux 磁盘 (查看、划分、inode)
linux·运维·服务器
ManageEngine卓豪1 小时前
从性能故障到安全风险,现代企业数字化转型下的网络丢包运维管控指南
运维·网络安全·网络故障·网络丢包
ai产品老杨2 小时前
架构师深剖:基于 Docker 容器化与边缘计算的 AI 视频管理平台——支持 GB28181/RTSP 多协议接入与全源码交付
人工智能·docker·边缘计算
Urbano3 小时前
工装 T 恤、Polo 衫全生产工序、痛点解析及多品牌自动化设备应用方案
运维·自动化
AOwhisky3 小时前
Redis 学习笔记(第一期):概述、安装配置与核心理论
运维·数据库·redis·笔记·学习·云计算
AOwhisky3 小时前
Redis 学习笔记(第四期):高可用与集群(哨兵 + Cluster + 容器化)
linux·运维·数据库·redis·笔记·学习·缓存
C语言小火车4 小时前
嵌入式Linux应用开发技术栈完全指南
linux·运维·服务器