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.

相关推荐
服务器硬件项目经理几秒前
第14篇_服务器主板上MOSFET的三大应用
运维·服务器·人工智能·单片机·硬件工程·硬件
科技研学社6 分钟前
无纺布贴身制品非标自动化落地复盘:一次性内裤产线的工程难点与解决方案
运维·自动化
爱学堂IT课程大全17 分钟前
零基础,Hermes Agent 多场景自动化实战
运维·人工智能·自动化
数智化码农44 分钟前
半导体制造人力资源数字化选型:适配双用工体系,兼顾合规与人效
大数据·运维·python·制造
Meta391 小时前
cenots8安装docker
docker·容器·centos
团子股股东峥哥1 小时前
day36-RHEL-管理基本存储
linux·运维·服务器
努力努力再努力wz1 小时前
【Docker入门系列】从 LXC 到 containerd:一文梳理 Docker 容器运行时架构演进与轻量化原理
docker·eureka·架构
anqianqi1231 小时前
上网行为监控系统怎么落地:上网行为监控软件能管哪几件事
运维·安全·网络安全·电脑
TomEval1 小时前
【App 自动化】15 - App 自动化框架搭建
运维·自动化
云栖梦泽2 小时前
网络设备驱动(3)
linux·运维·服务器·网络·嵌入式硬件