title: Extending docker official postgres image
body: <p>I'm trying to extend the official docker postgres image in order to install a custom python module so I can use it from withing a plpython3 stored procedure.</p>
  
  <p>Here's my dockerfile</p>
  
  <pre><code>FROM postgres:9.5
  RUN apt-get update &amp;&amp; apt-get install -y postgresql-plpython3-9.5 python3
  ADD ./repsug/ /opt/smtnel/repsug/
  WORKDIR /opt/smtnel/repsug/
  RUN ["python3", "setup.py", "install"]
  WORKDIR /
  </code></pre>
  
  <p>My question is: do I need to add ENTRYPOINT and CMD commands to my Dockerfile? Or are they "inherited" FROM the base image?</p>
  
  <p>The example in the official readme.md shows a Dockerfile which only changes the locale, without ENTRYPOINT or CMD.</p>
  
  <p>I also read in the readme that I can extend the image by executing custom sh and/or sql scripts. Should I use this feature instead of creating my custom image? The question in this case is how I make sure the scripts are run only once at "install time" and not every time? I mean, if the database is already created and populated, I would not want to overwrite it.</p>
  
  <p>Thanks,
  Awer</p>