I am trying to extend the official postgres docker image to install a custom python module so that I can use it with the plpython3 stored procedure.
Here is 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 the ENTRYPOINT and CMD commands to my Docker file? Or are they "inherited" from the base image?
The official readme.md file shows a Docker file that only changes the locale without ENTRYPOINT or CMD.
I also read in readme that I can expand the image by running custom sh and / or sql scripts. Should I use this function instead of creating my own image? The question in this case is how do I make sure that the scripts are run only once at the "installation time", and not every time? I mean, if the database is already created and full, I would not want to overwrite it.
Thanks Awer
source share