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.

相关推荐
wangjialelele1 小时前
Linux下的IO操作以及ext系列文件系统
linux·运维·服务器·c语言·c++·个人开发
广州中轴线1 小时前
OpenStack on Kubernetes 生产部署实战(十三)
容器·kubernetes·openstack
HypoxiaDream1 小时前
LINUX-Ext系列⽂件系统
linux·运维·服务器
小毛驴8501 小时前
Linux curl 命令用法
linux·运维·chrome
李斯啦果1 小时前
【Linux】Linux目录配置
linux·运维·服务器
AI+程序员在路上1 小时前
linux下线程中pthread_detach与pthread_join区别
linux·运维·服务器
logocode_li1 小时前
说透 Linux Shell:命令与语法的底层执行逻辑
linux·运维·ssh
来鸟 鸣间2 小时前
Linux下3个so库之间的关系
linux·运维
释怀不想释怀2 小时前
Linux文件上传(rz)和下载(sz)压缩(tar.gz)和解压(zip)
linux·运维·服务器
IOsetting2 小时前
金山云主机添加开机路由
运维·服务器·开发语言·网络·php