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.

相关推荐
sel_95 小时前
【Docker】Docker 安装与使用详解:从零搭建到日常实战
人工智能·深度学习·算法·docker
小玮看世界5 小时前
[Python]从40分到100分:一场关于编程思维的“辩论赛”
运维·服务器
goyeer5 小时前
Liunx日志管理与journalctl
java·linux·运维·服务器·运维开发·信息化·信息化企业管理
酷可达拉斯5 小时前
自动化运维-Ansible Role综合应用案例-基于LNMP部署wordpress
linux·运维·服务器·自动化·ansible
无望__wsk6 小时前
k8s部署
云原生·容器·kubernetes
Lonely 净土14 小时前
Linux 运维文件写入操作
linux·运维·服务器·文件管理
飞英思特无线充电14 小时前
严苛场景巡检机器人的无线补能设计:点位、BMS、认证与运维边界
运维·机器人
Jimmy_jimi15 小时前
利用nginx代理完成url重定位
运维·nginx
卷无止境15 小时前
Windows 上丝滑开发 Python,并稳定构建 Docker 镜像
后端·python·docker
liuyicenysabel15 小时前
多服务上线日记三:
运维·服务器·笔记·学习