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.

相关推荐
不念霉运8 分钟前
2025年中国DevOps工具选型指南:主流平台能力横向对比
运维·ci/cd·团队开发·devops
珹洺21 分钟前
Jsp技术入门指南【十四】实现基于MySQL+JDBC+JSP数据库验证的登录界面与登录跳转功能
java·运维·数据库·mysql·servlet
dadeity33 分钟前
Linux 离线安装 Docker 和 Docker Compose 最新版 的完整指南
linux·docker·docker-compose
珹洺34 分钟前
计算机操作系统(七)详细讲解进程的组成与特性,状态与转换
运维·服务器·计算机网络
EulerBlind1 小时前
【运维】MacOS蓝牙故障排查与修复指南
运维·macos
大大小小聪明1 小时前
Nginx核心功能及同类产品对比
运维·nginx
wangchen_01 小时前
linux-进程信号的产生
linux·运维·服务器
乌鸦乌鸦你的小虎牙2 小时前
linux 抓包工具tcpdump使用小记(使用时注意权限和系统资源)
linux·运维·tcpdump
小小寂寞的城2 小时前
Jenkins里构建一个简单流水线
java·运维·jenkins
*郑*2 小时前
nginx配置反向代理支持CORS跨域请求
运维·nginx