Skip to content

Commit 41ba59a

Browse files
committed
Add Dockerfile to provide Postgres with PgDD extension.
1 parent 12cd548 commit 41ba59a

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
Dockerfile*

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM postgres:12
2+
3+
ENV PG_MAJOR 12
4+
5+
LABEL maintainer="PgDD Project - https://github.com/rustprooflabs/pgdd"
6+
7+
RUN apt-get update \
8+
&& apt-cache showpkg postgresql-$PG_MAJOR \
9+
&& apt-get install -y --no-install-recommends \
10+
make \
11+
postgresql-server-dev-$PG_MAJOR \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
WORKDIR /tmp/pgdd
15+
COPY *.sql ./
16+
COPY pgdd.control ./
17+
COPY Makefile ./
18+
19+
RUN make install
20+

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ The PostgreSQL Data Dictionary (`pgdd`) is an in-database solution to provide
44
introspection via standard SQL query syntax. This extension makes it easy to
55
provide a usable data dictionary to all users of a PostgreSQL database.
66

7+
## Compatability
8+
9+
PgDD has been tested and found to work against PostgreSQL 10
10+
through 13-beta2.
11+
12+
Docker images available on
13+
[Docker Hub](https://hub.docker.com/r/rustprooflabs/pgdd).
14+
715

816
## Install `pgdd`
917

@@ -42,6 +50,32 @@ psql -d your_db
4250
CREATE EXTENSION pgdd;
4351
```
4452

53+
## Docker Image
54+
55+
Build Docker image. Uses [main Postgres image](https://hub.docker.com/_/postgres/) as starting point, see that
56+
repo for full instructions on using the core Postgres functionality.
57+
58+
```
59+
docker build -t rustprooflabs/pgdd .
60+
```
61+
62+
Build with tag.
63+
64+
Run Postgres in Docker.
65+
66+
```
67+
docker run --name test-pgdd12 -e POSTGRES_PASSWORD=mysecretpassword -p 6512:5432 -d rustprooflabs/pgdd
68+
```
69+
70+
Connect via `psql` using `postgres` role, provide password from prior step
71+
when prompted.
72+
73+
```
74+
psql -h host_or_ip -p 6512 -U postgres
75+
```
76+
77+
78+
4579
## Database Permissions
4680

4781
Create Read-only group role to assign to users
@@ -82,6 +116,7 @@ GRANT dd_readwrite TO <your_login_user>;
82116
```
83117

84118

119+
85120
## Use Data Dictionary
86121

87122
Connect to your database using your favorite SQL client. This

0 commit comments

Comments
 (0)