Docker Postgresql installation quickly


[root@02a854a7db8d /]# uname -r
3.10.0–862.14.4.el7.x86_64
[root@02a854a7db8d /]#
Use root login, or provide an account with sudo permissions, it should be possibleUpdate yum first[root@pankajconnect ~]# yum update -y

Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.njupt.edu.cn
* updates: mirrors.aliyun.com
Resolving Dependencies
→ Running transaction check
Where -y stands for automatic reply yes to prevent this
[root@pankajconnect ~]# yum install docker -y
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.njupt.edu.cn
* updates: mirrors.aliyun.com
Resolving Dependencies
— — — -
Next start dockersystemctl status docker.serviceafter finishing[root@pankajconnect Desktop]# docker search postgres--Continue as below....
[root@pankajconnect data]# run, Create and run a container;, 
— namespecify the name of the created container
-e POSTGRES_PASSWORD=password;, set environment variables, specify the database login password as password;, -p 5432:5432port mapping will map the container’s 5432 port to the external machine’s 54321 port;

postgres=# show port;
port
— — —
5432
(1 row)

postgres=# show config_file ;
config_file
— — — — — — — — — — — — — — — — — — — — —
/var/lib/postgresql/data/postgresql.conf
(1 row)
postgres=# \q
Note : 
Postgres mirroring default user name postgres,
login password for the creation of a container is the specified value.
[root@pankajconnect ~]# [root@pankajconnect ~]# psql -h 192.168.40.105 -p 5432 -d postgres -U postgres

--

--

--

Database/System Administrator | DevOPS | Cloud Specialist | DevOPS

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Luigi — Microfrontend Framework

Helmfile vs Ansible

Java : Uneasy Interview Questions — 1

Week 2 at TIY Indy

The Most Common HTTP Status Codes and Their Meanings

404 Page Not Found HTTP status code

Node.js or PHP — Which is better?

HTTP Strict Transport Security FAQs

What To Do After Learning the Basics of a Programming Language?

Person looking at the sky, holding a backpack

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pankaj kushwaha

Pankaj kushwaha

Database/System Administrator | DevOPS | Cloud Specialist | DevOPS

More from Medium

Simple CI CD with GCP Cloud Build using Docker- part 1

Elasticsearch 8: express installation guide

Solutions for Operation not permitted error when Postgresql is running on Docker using Vagrant’s…

Deploy Flask application on GCP Cloud Run