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.

相关推荐
Lovyk1 小时前
Linux 正则表达式
linux·运维
ac.char3 小时前
在CentOS系统中查询已删除但仍占用磁盘空间的文件
linux·运维·centos
罗不俷4 小时前
【RH134知识点问答题】第13章:运行容器
容器·rhel
中科米堆4 小时前
中科米堆CASAIM自动化三维测量设备测量汽车壳体直径尺寸
运维·自动化·汽车·视觉检测
缘华工业智维5 小时前
CNN 在故障诊断中的应用:原理、案例与优势
大数据·运维·cnn
开航母的李大6 小时前
软件系统运维常见问题
运维·服务器·系统架构·运维开发
AI大模型6 小时前
基于 Docker 的 LLaMA-Factory 全流程部署指南
docker·llm·llama
华强笔记7 小时前
Linux内存管理系统性总结
linux·运维·网络
tb_first8 小时前
k8sday11服务发现(2/2)
docker·云原生·容器·kubernetes·k8s
拾心218 小时前
【运维进阶】Ansible 角色管理
运维·ansible