You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updated with up to date information for pg_tde encryption parameters, also, cleaned the document a bit, added a paragraph recommending the user to see the pg_tde docs, added a note bolding the fact that we do not recommend using a local keyring file and we suggest using an external KMS.
Copy file name to clipboardExpand all lines: docs/docker.md
+22-26Lines changed: 22 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Docker images of Percona Distribution for PostgreSQL are hosted publicly on [Doc
4
4
5
5
For more information about using Docker, see the [Docker Docs :octicons-link-external-16:](https://docs.docker.com/).
6
6
7
-
!!! note ""
7
+
!!! note
8
8
9
9
Make sure that you are using [the latest version of Docker :octicons-link-external-16:](https://docs.docker.com/get-docker/). The ones provided via `apt` and `yum` may be outdated and cause errors.
10
10
@@ -35,16 +35,15 @@ For more information about using Docker, see the [Docker Docs :octicons-link-ext
35
35
36
36
```{.bash data-prompt="$"}
37
37
$ docker run --name container-name -e POSTGRES_PASSWORD=secret -d percona/percona-distribution-postgresql:{{dockertag}}
38
-
```
38
+
```
39
39
40
-
Where:
40
+
Where:
41
41
42
42
*`container-name` is the name you assign to your container
43
43
*`POSTGRES_PASSWORD` is the superuser password
44
-
*`{{dockertag}}` is the tag specifying the version you need. Docker identifies the architecture (x86_64 or ARM64) and pulls the respective image. See the [full list of tags :octicons-link-external-16:](https://hub.docker.com/r/percona/percona-distribution-postgresql/tags/).
45
-
44
+
*`{{dockertag}}` is the tag specifying the version you need. Docker identifies the architecture (x86_64 or ARM64) and pulls the respective image. See the [full list of tags :octicons-link-external-16:](https://hub.docker.com/r/percona/percona-distribution-postgresql/tags/).
46
45
47
-
!!! tip
46
+
!!! tip
48
47
49
48
You can secure the password by exporting it to the environment file and using that to start the container.
50
49
@@ -60,15 +59,14 @@ For more information about using Docker, see the [Docker Docs :octicons-link-ext
60
59
$ docker run --name container-name --env-file ./.my-pg.env -d percona/percona-distribution-postgresql:{{dockertag}}
61
60
```
62
61
63
-
2. Connect to the container's interactive terminal:
62
+
2. Connect to the container's interactive terminal:
64
63
65
64
```{.bash data-prompt="$"}
66
65
$ docker exec -it container-name bash
67
66
```
68
67
69
68
The `container-name` is the name of the container that you started in the previous step.
70
69
71
-
72
70
## Connect to Percona Distribution for PostgreSQL from an application in another Docker container
73
71
74
72
This image exposes the standard PostgreSQL port (`5432`), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container:
* `app-container-name` is the name of the container where your application is running,
83
-
* `container name` is the name of your Percona Distribution for PostgreSQL container, and
80
+
* `app-container-name` is the name of the container where your application is running,
81
+
* `container name` is the name of your Percona Distribution for PostgreSQL container, and
84
82
* `app-that-uses-postgresql` is the name of your PostgreSQL client.
85
83
86
84
## Connect to Percona Distribution for PostgreSQL from the `psql` command line client
@@ -95,15 +93,14 @@ Where:
95
93
96
94
* `db-container-name` is the name of your database container
97
95
* `container-name` is the name of your container that you will use to connect to the database container using the `psql` command line client
98
-
* `{{dockertag}}` is the tag specifying the version you need. Docker identifies the architecture (x86_64 or ARM64) and pulls the respective image.
99
-
* `address` is the network address where your database container is running. Use 127.0.0.1, if the database container is running on the local machine/host.
96
+
* `{{dockertag}}` is the tag specifying the version you need. Docker identifies the architecture (x86_64 or ARM64) and pulls the respective image.
97
+
* `address` is the network address where your database container is running. Use 127.0.0.1, if the database container is running on the local machine/host.
100
98
101
99
## Enable encryption
102
100
103
-
Percona Distribution for PostgreSQL Docker image includes the `pg_tde` extension to provide data encryption. You must explicitly enable it when you start the container.
101
+
Percona Distribution for PostgreSQL Docker image includes the `pg_tde` extension to provide data encryption. You must explicitly enable it when you start the container. For more information, see the [`pg_tde` documentation](https://docs.percona.com/pg-tde/index.html).
104
102
105
-
Here's how to do this:
106
-
{.power-number}
103
+
Follow these steps to enable `pg_tde`:
107
104
108
105
1. Start the container with the `ENABLE_PG_TDE=1` environment variable:
109
106
@@ -112,11 +109,10 @@ Here's how to do this:
112
109
```
113
110
114
111
where:
115
-
112
+
116
113
* `container-name` is the name you assign to your container
117
114
* `ENABLE_PG_TDE=1` adds the `pg_tde` to the `shared_preload_libraries` and enables the custom storage manager
118
-
*`POSTGRES_PASSWORD` is the superuser password
119
-
115
+
* `POSTGRES_PASSWORD` is the superuser password
120
116
121
117
2. Connect to the container and start the interactive `psql` session:
122
118
@@ -139,20 +135,21 @@ Here's how to do this:
139
135
CREATE EXTENSION pg_tde;
140
136
```
141
137
142
-
4. Configure a key provider. In this sample configuration intended fortesting and development purpose, we use a local keyring provider.
138
+
4. Configure a key provider with a keyring file. This setup is intended for development and stores the keys unencrypted in the specified data file. The below sample configuration is intended for testing and development purposes.
143
139
144
-
For production use, set up an external key management store and configure an external key provider. Refer to the [Setup :octicons-link-external-16:](https://docs.percona.com/pg-tde/setup.html#key-provider-configuration) chapter in the `pg_tde` documentation.
140
+
!!! note
141
+
For production use, we **strongly recommend** setting up an external key management store and configure an external key provider. Refer to the [Setup :octicons-link-external-16:](https://docs.percona.com/pg-tde/setup.html#key-provider-configuration) topic in the `pg_tde` documentation.
145
142
146
143
<i warning>:material-information: Warning:</i> This example is for testing purposes only:
The key is autogenerated. You are ready to use data encryption.
@@ -180,7 +177,7 @@ To enable the `pg_stat_monitor` extension after launching the container, do the
180
177
\d pg_stat_monitor;
181
178
```
182
179
183
-
??? example "Output"
180
+
??? example "Output"
184
181
185
182
```
186
183
View "public.pg_stat_monitor"
@@ -228,6 +225,5 @@ To enable the `pg_stat_monitor` extension after launching the container, do the
228
225
wait_event_type | text | | |
229
226
```
230
227
231
-
Note that the `pg_stat_monitor` view is available only for the databases where you enabled it. If you create a new database, make sure to create the view for it to see its statistics data.
232
-
233
-
228
+
!!! note
229
+
The `pg_stat_monitor` view is available only for the databases where you enabled it. If you create a new database, make sure to create the view for it to see its statistics data.
0 commit comments