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.

相关推荐
洋哥网络科技4 分钟前
centos7 升级openssh-10.2
linux·运维·服务器·系统安全
smileNicky11 分钟前
Docker 部署 SpringBoot 项目超详细教程
spring boot·docker·容器
IpdataCloud15 分钟前
企业级IP定位服务准确率怎么保证?从数据源到离线库的精度提升指南
运维·服务器·网络·数据库·tcp/ip
派葛穆43 分钟前
Ubuntu-软件安装和执行
linux·运维·ubuntu
AlickLbc1 小时前
WSL2安装Ubuntu与Claude Code记录
linux·运维·ubuntu
青天喵喵1 小时前
Linux WiFi 架构解析:连接流程(基础篇二)
linux·运维·架构·嵌入式·wi-fi·sta·ap
珂玥c1 小时前
kubeadm方式部署 k8s 1.21
云原生·容器·kubernetes
雨的旋律20991 小时前
linux网卡绑定bond设置一步不少
linux·运维·网络
MXsoft6182 小时前
**国产化环境下运维平台如何做到全栈适配、自主可控?**
运维
是垚不是土2 小时前
PostgreSQL 运维工程师 “一本通“ :安装、配置、备份与监控
linux·运维·数据库·postgresql·运维开发