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.

相关推荐
Patrick在香港7 小时前
Python Docker镜像从1.2GB到89MB:多阶段构建的完整优化实录
java·python·docker·信息可视化·容器·数据分析·ai编程
微三云 - 廖会灵 (私域系统开发)10 小时前
抖店 OPC 自动化运营系统架构与商业代理分控体系完整解析
运维·系统架构·自动化
办公室马主任11 小时前
华南机械加工企业选MES服务商怎么选?
大数据·运维·人工智能·制造
小陈同学!!11 小时前
防火墙双机热备实验
运维·服务器
三言老师11 小时前
CentOS8 Firewalld 高级规则中级实操教程
linux·运维·服务器·网络·centos
Promise微笑12 小时前
露点仪:康高特朝露(冷镜)vs 进口密析尔 、肖氏,怎么选?
运维
云贝贝贝13 小时前
OceanBase认证体系介绍与备考指南
运维·服务器·oceanbase·1024程序员节
tedcloud12313 小时前
Impeccable 部署指南:开源前端设计工具 Linux 环境搭建实践
linux·运维·服务器·前端·人工智能·开源
风曦Kisaki13 小时前
# Kubernetes(K8s)笔记Day12 :K8s 七层代理(Ingress 和 Ingress Controller)
linux·笔记·云原生·容器·kubernetes
Lyra_Infra13 小时前
Docker OCI Runtime 启动失败问题排查与解决
后端·docker·架构