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.

相关推荐
汀、人工智能15 分钟前
修改Docker默认存储路径,解决系统盘占用90%+问题(修改docker root dir)
docker·容器
吃面不喝汤6640 分钟前
如何配置和使用自己的私有 Docker Registry
运维·docker·容器
Rookie_explorers1 小时前
Linux下go环境安装、环境配置并执行第一个go程序
linux·运维·golang
学习向前冲1 小时前
AD域控服务器
运维·服务器
Leighteen1 小时前
Docker常用命令
docker·容器
hgdlip1 小时前
查看ip地址的方法有几种?探索多样方法
运维·服务器·ip地址
丶21361 小时前
【Nginx】在 Docker 上安装 Nginx 的详细指南
运维·nginx·docker
codelife3211 小时前
在Docker容器中执行命令
容器
神即道 道法自然 如来1 小时前
Jenkins怎么设置每日自动执行构建任务?
运维·jenkins
petaexpress2 小时前
常用的k8s容器网络模式有哪些?
网络·容器·kubernetes