More information about the image, additional example for docker-compose custom image generation.
This commit is contained in:
parent
015f5601cc
commit
8a1a8a4e5b
1 changed files with 20 additions and 3 deletions
23
README.md
23
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
## About
|
||||
|
||||
This is a special image that I created out of necessity to have a dynamic User ID and Group ID for the data of the PostgreSQL, while also solving the default listen address problem normally happening with Docker, without touching configuration. It will always listen to all network addresses. Additionally we use a Debian image and install the Debian packages for all the PostgreSQL modules from the official PostgreSQL Debian repository. This allows to activate them on demand. The image also contains a proper healthcheck that checks 4 times on the interval of 30 seconds with a timeout of 3 seconds. If you need this configurable, please contact me. The user will be called *postgres* and his home will be **/var/lib/postgresql**. The PostgreSQL itself is installed under **/data**. Additionally the image is not running as *root*.
|
||||
This is a special image that I created out of necessity to have a dynamic User ID and Group ID for the data of the PostgreSQL, while also solving the default listen address problem normally happening with Docker, without touching configuration. It will always listen to all network addresses. Additionally we use a Debian image and install the Debian packages for all the PostgreSQL modules from the official PostgreSQL Debian repository. This allows to activate them on demand. The image also contains a proper healthcheck that checks 4 times on the interval of 30 seconds with a timeout of 3 seconds. If you need this configurable, please contact me. The user will be called *postgres* and his home will be **/var/lib/postgresql**. The PostgreSQL itself is installed under **/data**. Additionally the image is not running as *root* and is using the official Docker image *docker-entrypoint.sh* as documented on the [PostgreSQL Docker Hub page](https://hub.docker.com/_/postgres).
|
||||
|
||||
## How To Use
|
||||
|
||||
|
@ -10,11 +10,28 @@ If you use the image, you will have to make a mount for the **/data** directory
|
|||
|
||||
### Image Name
|
||||
|
||||
The image name to use the image in your Docker is **docker.ci/srv/postgres:latest**. This is only applicable, if you do not want to change the User ID and Group ID.
|
||||
The image name for your Docker is **docker.ci/srv/postgres:latest**. This is only applicable, if you do not want to change the User ID and Group ID.
|
||||
|
||||
### ARGS
|
||||
|
||||
For changing the ARGS, you need to copy the repository and build the image yourself with setting the necessary ARGS to get a new image. As convention, you could use the User ID as the tag name for your new image, we will not make an official tag that is just a number, so you will not collide here in the future. Of course, you can also just give it then a complete new image name, so that there can't be any collide.
|
||||
For changing the ARGS, you need to copy the repository and build the image yourself with setting the necessary ARGS to get a new image. As convention, you could use the User ID as the tag name for your new image, we will not make an official tag that is just a number, so you will not collide here in the future. Of course, you can also just give it then a complete new image name, so that there can't be any collide. You can also *git submodule* the repository in a subdirectory and then add it with args to your Docker-Compose configuration, like in this example, assuming you put the submodule of the repository under *docker/postgres*:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
db:
|
||||
image: "docker.ci/srv/postgres:1010"
|
||||
volumes:
|
||||
- "db-volume:/data"
|
||||
environment:
|
||||
POSTGRES_USER: "myuser"
|
||||
POSTGRES_DBNAME: "myuser"
|
||||
POSTGRES_PASSWORD: "mypass"
|
||||
ALLOW_IP_RANGE: "0.0.0.0/0"
|
||||
build:
|
||||
context: "docker/postgres"
|
||||
args:
|
||||
SRV_UID: "1010"
|
||||
```
|
||||
|
||||
#### SRV_UID
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue