Docker image for postgresql with additional extentions.
Building the docker image.
docker build -t postgresql:with-extentions-15-4 .
Running the docker image.
docker run -itd --restart always --name postgresql-with-extentions-15-4 \
-e POSTGRES_PASSWORD=YOUR_DB_PASSWORD \
-v ./pgsql-db/data:/var/lib/postgresql/data \
-v ./pgsql-db/log:/var/log/postgresql \
postgresql:with-extentions-15-4
Check that all the extentions are loaded.
- Get the container ip address.
docker inspect postgresql-with-extentions-15-4
docker run -it --rm postgresql:with-extentions-15-4 psql -h IPADDR_OF_CONTAINER -U postgres -c 'select * from pg_extension;'
- Checking the container logs.