The default php.ini file that the docker php images look for is:
/usr/local/etc/php/php.ini
You can see this in the output from the phpinfo function (just run "php -a" in the container and then "phpinfo();" at the prompt):
Configuration File (php.ini) Path => /usr/local/etc/php
Loaded Configuration File => /usr/local/etc/php/php.ini
You can always link this file in as a volume to get a custom one when running the container with a -v option like:
docker run -v /local/path/to/php.ini:/usr/local/etc/php/php.ini [OPTIONS] IMAGE [COMMAND] [ARG...]
I typically prefer to use the default ini file that comes with it, with just a few modified options as I need them. If you want your container to do this during build, you can do something like the following in the Dockerfile:
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && \
sed -i -e "s/^ *memory_limit.*/memory_limit = 4G/g" /usr/local/etc/php/php.ini
The RUN commands above will copy the default production ini file, and then will modify the memory_limit and set it to 4G in the ini file.
I prefer this method because it allows custom configurations to be used so the container always works with defaults when it's pulled, but you still have the option to override the ini file in the container by passing a volume in.