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.

相关推荐
c无序3 小时前
Docker-技术架构演进之路
docker
努力的小T6 小时前
使用 Docker 部署 Apache Spark 集群教程
linux·运维·服务器·docker·容器·spark·云计算
枫叶落雨2228 小时前
08-Elasticsearch
运维·jenkins
东风微鸣8 小时前
TTRSS 迁移实战
docker·云原生·kubernetes·可观察性
爆更小小刘9 小时前
Linux下基本指令(4)
linux·运维·服务器
我码玄黄9 小时前
解决本地模拟IP的DHCP冲突问题
linux·运维
若云止水9 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_os_init 函数
运维·nginx
Self-Discipline9 小时前
Linux arm64 IOMMU总结
linux·运维·服务器
我言秋日胜春朝★9 小时前
【Linux】命名管道------Linux进程间通信的桥梁
linux·运维·服务器
Dontla10 小时前
华为昇腾服务器(固件版本查询、驱动版本查询、CANN版本查询)
运维·服务器·chrome