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.

相关推荐
longerxin2020几秒前
kubeasz 快速指南:一键部署 Kubernetes-k8s 测试环境
云原生·容器·kubernetes
桌面运维家2 分钟前
校园机房vDisk IDV云桌面Linux更新部署方案
linux·运维·服务器
cyber_两只龙宝10 分钟前
【Oracle】 Oracle之SQL的子查询
linux·运维·数据库·sql·云原生·oracle
遇印记16 分钟前
网络运维DDos攻击
运维·网络·ddos
司南-704925 分钟前
opencode环境搭 并 配置自定义BASE URL
linux·运维·服务器·人工智能
米高梅狮子40 分钟前
03.Kubernetes自动化部署和namespace、pod
容器·kubernetes·自动化
特长腿特长1 小时前
LVS_DR 模式的原理
linux·运维·网络·云原生·centos·lvs
yyk的萌1 小时前
Claude Code 命令大全
linux·运维·服务器·ai·claude code
Sirius Wu2 小时前
Docker 镜像的构建、打包、变更、再次打包全流程
运维·docker·容器
Harvy_没救了2 小时前
【Linux】Nginx - 反向代理
linux·运维·nginx