@@ -10,46 +10,9 @@ This tutorial explains how to build, run, and configure the CedarDB docker image
1010
1111## Quick start
1212
13- The following steps will create an empty database called ` postgres `
14- which you can connect to using the ` postgres ` user with the password ` test ` .
15- The database will be deleted when you stop the Docker container.
16-
17- {{% steps %}}
18-
19-
20- ### Get the docker file
21-
22- {{% waitlist %}}
23-
24-
25- ### Build the docker image
26-
27- Go to the path where you have downloaded the CedarDB docker file and run
28- ``` shell
29- docker build -t cedardb .
30- ```
31-
32- ### Launch the docker container
33-
34- Minimal working example:
35-
36-
37- ``` shell
38- # Start the container
39- docker run --rm -p 5432:5432 -e CEDAR_PASSWORD=test --name cedardb_test cedardb
40-
41- # Connect to CedarDB
42- psql -h localhost -U postgres
43- # <Enter test as password>
44-
45- postgres= SELECT 1 as foo;
46- foo
47- -----
48- 1
49- (1 row)
50- ```
51-
52- {{% /steps %}}
13+ {{< callout type="info" >}}
14+ For the quick start follow the [ Quick Start] ( /docs/getting_started/quickstart.md ) page.
15+ {{< /callout >}}
5316
5417## Configuration
5518
@@ -58,7 +21,7 @@ Here's a few ways to customize the CedarDB docker image for your specific use ca
5821
5922### Make the database persistent
6023
61- If you want your database to survive beyond the lifetime of your docker container,
24+ If you want your database to survive beyond the lifetime of your docker container,
6225you can mount a directory of the host system for CedarDB to store the database files in:
6326
6427``` shell
@@ -73,7 +36,7 @@ If the directory already contains a database, CedarDB will start the existing on
7336
7437` [INFO] CedarDB Database directory appears to contain a database; Skipping initialization. `
7538
76- In this case, it expects you to use the credentials of the existing database
39+ In this case, it expects you to use the credentials of the existing database
7740and ** will not** use the username or password passed via the environment variable.
7841{{< /callout >}}
7942
@@ -89,7 +52,7 @@ You have three ways to initialize the database with your credentials: Via enviro
8952``` shell
9053docker run --rm -p 5432:5432 -e CEDAR_USER=test -e CEDAR_PASSWORD=test -e CEDAR_DB=db --name cedardb_test cedardb
9154```
92- This command initializes a new superuser with the name ` test ` , the password ` test ` and a logical database with named ` db ` .
55+ This command initializes a new superuser with the name ` test ` , the password ` test ` and a logical database with named ` db ` .
9356
9457You can then connect as follows:
9558``` shell
@@ -98,7 +61,7 @@ psql -h localhost -U test -d db
9861
9962The parameters ` CEDAR_USER ` and ` CEDAR_DB ` are optional:
10063- If ` CEDAR_USER ` isn't set, the default ` postgres ` is used instead.
101- - If ` CEDAR_DB ` isn't set, the value of ` CEDAR_USER ` is used instead.
64+ - If ` CEDAR_DB ` isn't set, the value of ` CEDAR_USER ` is used instead.
10265
10366
10467#### Via domain socket
@@ -129,7 +92,7 @@ You can manage such files e.g. via [Docker secrets](https://docs.docker.com/engi
12992
13093### Preloading data
13194
132- You may want to pre-populate your database with some data.
95+ You may want to pre-populate your database with some data.
13396Whenever a CedarDB Docker container initializes a new database, it considers all files in the ` /docker-entrypoint-initdb.d/ ` for preloading.
13497You can use this to create your own Docker image with your own data that inherits from the CedarDB image.
13598
@@ -186,23 +149,23 @@ psql -h localhost -U postgres
186149
187150postgres= \d
188151 List of relations
189- Schema | Name | Type | Owner
152+ Schema | Name | Type | Owner
190153--------+--------+-------+----------
191154 public | foo | table | postgres
192155 public | movies | table | postgres
193156(2 rows)
194157
195158
196159postgres= select * from movies;
197- id | title | year | length | genre
160+ id | title | year | length | genre
198161----+-----------------------------------+------+--------+-----------------
199162 1 | Oppenheimer | 2023 | 180 | Biopic
200163 2 | Everything Everywhere All at Once | 2022 | 139 | Science Fiction
201164 3 | Das Boot | 1981 | 149 | Drama
202165(3 rows)
203166
204167postgres= select * from foo;
205- a
168+ a
206169---
207170 7
208171(1 row)
@@ -212,4 +175,4 @@ postgres= select * from foo;
212175{{< callout type=" info" > }}
213176In addition to plain shell scripts and sql files, the CedarDB docker image also accepts ` xz` , ` gzip` , or ` zstd` compressed sql files.
214177A file must have one of the following extensions: ` .sql` , ` .sql.gz` , ` sql.xz` , ` sql.zst` , or ` .sh` .
215- {{< /callout > }}
178+ {{< /callout > }}
0 commit comments