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

How to resize the static partition in Linux without losing your data?

Secondly, when these patients with COVID-19 crash, they crash very quickly and crash very hard

Week 9 ½ — HTTP Verbs & Query Parameters — To Do List

Problem-solving not feature-building

The Simple Guide: Deep Learning with RTX 3090 (CUDA, cuDNN, Tensorflow, Keras, PyTorch)

Don’t Let These Myths Keep You From Realizing The True Potential Of Cloud

It doesn’t matter how difficult

The 3 goals of application monitoring

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

The Guide to Docker ARG, ENV and .env

Reduce your docker image size with .dockerignore

Accessing Docker tag as an environment variable inside a Docker container project

Migrating a PostgreSQL database from on-prem to Azure Database for PostgreSQL with (almost) zero…