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.
Here's my dockerfile
FROM postgres:9.5
RUN apt-get update && apt-get install -y postgresql-plpython3-9.5 python3
ADD ./repsug/ /opt/smtnel/repsug/
WORKDIR /opt/smtnel/repsug/
RUN ["python3", "setup.py", "install"]
WORKDIR /
My question is: do I need to add ENTRYPOINT and CMD commands to my Dockerfile? Or are they "inherited" FROM the base image?
The example in the official readme.md shows a Dockerfile which only changes the locale, without ENTRYPOINT or CMD.
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.
Thanks, Awer