For those trying to run custom command using the official docker image, use the following command. docker-entrypoint.sh
handles switching the user and handling other permissions.
docker-entrypoint.sh -c 'shared_buffers=256MB' -c 'max_connections=200'