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.

相关推荐
Kratzdisteln3 分钟前
【Linux】Docker容器中快速部署VNC远程桌面环境
linux·运维·docker
魔众8 分钟前
轻量级云文件系统simple-file-server,电脑秒变存储服务器
运维·服务器
咸鱼xxx12 分钟前
N8N搭建Agent(Docker Desktop版本)
docker·ai·容器·agent·n8n
追光的孩子13 分钟前
window服务器添加samwaf防火墙遇到的问题和解决方案
运维·服务器
轻蓝雨18 分钟前
树莓派4B安装ubuntu server后再访问GPIO
linux·运维·ubuntu
XiaoHu020735 分钟前
Linux网络编程(第三弹)
linux·运维·网络
袁袁袁袁满41 分钟前
Docker服务彻底清空的所有相关资源(容器、镜像、网络、数据卷等)
linux·运维·ubuntu·docker·容器·docker清空资源·docker停掉资源
什么都不会的Tristan44 分钟前
微服务保护
运维·微服务·架构
Run_Teenage1 小时前
Linux:匿名管道(实现个进程池)和命名管道
linux·运维·服务器
warton881 小时前
proxysql配置mysql mgr代理,实现读写分离
linux·运维·数据库·mysql