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.

相关推荐
风曦Kisaki32 分钟前
#Linux数据库管理Day06:主从同步与MaxScale读写分离
linux·运维·数据库
Tipriest_2 小时前
ubuntu创建和更换当前swap大小
linux·运维·ubuntu
雨辰AI2 小时前
生产级实战:人大金仓 V9 标准化运维手册(日常巡检 + 监控告警 + 应急处置)
java·运维·数据库·后端
ejinxian2 小时前
微虚拟机 smolvm 与Docker 容器比较
运维·docker·容器·smolvm
ShiXZ2132 小时前
PDF-OCR文件识别篇(八):配置、运维与排错
java·运维·ocr·dubbo·springboot
爱码少年3 小时前
Docker如何一次查看多个容器日志
运维·docker·容器
WI8LbH7883 小时前
Ubuntu 部署Harbor
linux·运维·ubuntu
huainingning3 小时前
华三ACL单向TCP互通组网-通过Established状态回包实现
运维·网络·tcp/ip
蜀道山老天师3 小时前
K8s 数据存储全解析:从 EmptyDir 到 PV/PVC
云原生·容器·kubernetes
researcher-Jiang4 小时前
高性能计算之MPI:第一次MPI并行程序设计练习
linux·运维·服务器