File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848
49494. Optionally, you can secure your PostgreSQL installation by setting a password for the database superuser account (`postgres`).
5050
51+ ### Docker
52+
53+ 1. The prerequsite for this is installation of the docker containerzation tool docker
54+
55+ 2. Check the version of the docker tool
56+ ```
57+ docker --version
58+ ```
59+
60+ 3. Pull the offical postgreSql image
61+ ```
62+ docker pull postgres
63+ ```
64+
65+ 4. Start a postgresSql container
66+ ```
67+ docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
68+ ```
69+ - Replace the `mysecretpassword` with your desired password
70+ - This starts a container named my-postgres in the background
71+
72+ 5. Enter the postgresSql shell inside the container(only while running)
73+ ```
74+ docker exec -it my-postgres psql -U postgres
75+ ```
76+ - This opens the interative psql shell as the postgres user
77+
78+ 6. To stop and remove the container when done
79+ ```
80+ docker stop my-postgres
81+ docker rm my-postgres
82+ ```
83+
5184---
You can’t perform that action at this time.
0 commit comments