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.

相关推荐
s***4535 小时前
Linux 下安装 Golang环境
linux·运维·golang
JobDocLS5 小时前
Ubuntu22.04的安装方法
运维
w***76555 小时前
用docker启动mysql步骤
mysql·docker·容器
p***q786 小时前
docker离线安装及部署各类中间件(x86系统架构)
docker·中间件·系统架构
d***95626 小时前
docker 安装 mysql
mysql·adb·docker
豆豆的java之旅6 小时前
深入浅出Activity工作流:从理论到实践,让业务流转自动化
java·运维·自动化·activity·工作流
4***17547 小时前
Linux 下安装 Golang环境
linux·运维·golang
Lenyiin7 小时前
《 Linux 修炼全景指南: 七 》 指尖下的利刃:深入理解 Vim 的高效世界
linux·运维·服务器·vim·lenyiin
sulikey9 小时前
Linux基础指令与权限管理深度解析:从入门到精通
linux·运维·服务器·ubuntu·centos·linux命令·linux权限
陌生人~9 小时前
docker安装redis
redis·docker