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.

相关推荐
小李独爱秋2 分钟前
模拟面试:什么是容器技术,Docker是什么?
运维·docker·容器·面试·职场和发展
yangyanping2010828 分钟前
系统监控Prometheus之Docker安装部署Prometheus
运维·docker·容器·prometheus
盟接之桥39 分钟前
制造业EDI数字化:连接全球供应链的桥梁
linux·运维·服务器·网络·人工智能·制造
大梦想家~1 小时前
在职牛马,因为考过阿里云ACP,浅说下一次过的强度
运维·云计算·网络工程师·阿里云acp·云计算工程师·阿里云acp考试·阿里云acp备考
西门吹雪分身1 小时前
K8S之Pod调度
java·容器·kubernetes·k8s
暴力求解2 小时前
Linux-进程(三)进程的孤儿状态和僵尸状态
linux·运维·服务器
乾元2 小时前
数据投毒:如何通过训练数据污染埋下“后门”
运维·人工智能·网络协议·安全·网络安全·系统架构·自动化
小鸡食米2 小时前
Keepalived高可用
运维·服务器·网络
DeeplyMind2 小时前
第18章 Docker Compose基础
docker·容器·eureka
dreams_dream2 小时前
docker清除所有网络
运维·docker·容器