I\'m using the official Postgres Docker image trying to customize its configuration. For this purpose, I use the command sed to change max_connections
sed
max_connections
This works for me:
FROM postgres:9.6 USER postgres # Copy postgres config file into container COPY postgresql.conf /etc/postgresql # Override default postgres config file CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]