Skip to content

Commit 0065563

Browse files
authored
Add Docker installation instructions for PostgreSQL (#14)
1 parent 996a58e commit 0065563

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

psql/installation.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,37 @@
4848
4949
4. 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
---

0 commit comments

Comments
 (0)