Answer a question

Problem

I have too many connection open using the default docker postgresql configuration

  • https://hub.docker.com/_/postgres/

Goal

I want to extend max_connection without using a volume for mounting the configuration (I need this to be available by default for my CI environment).

I have tried to use sed to edit the configuration but this has no effect.

What is the recommended way of overriding default configuration of postgresql docker official image?

Answers

It is as simple as (you just override the default CMD with postgres -N 500):

docker run -d --name db postgres:10 postgres -N 500

You can check it using:

docker run -it --rm --link db:db postgres psql -h db -U postgres

show max_connections;

max_connections 
-----------------
500
(1 row)
Logo

PostgreSQL社区为您提供最前沿的新闻资讯和知识内容

更多推荐