Docker Image improvements

docker
Docker Image improvements
0
Tags: #<Tag:0x00007f4a041c36a8>

(Christophe Cosnefroy) #1

Hi,

I have noticed your Docker image run several process inside (tomcat, postfix, …). I think, and I’m not alone, it’s a bad practice. (See https://devops.stackexchange.com/questions/447/why-it-is-recommended-to-run-only-one-process-in-a-container).

Could you improve that ?

Thanks.


(David AZOULAY) #2

The only process started in the images is the Tomcat server (I don’t remember why we install the “postfix” package but we don’t start a postfix process)


(Christophe Cosnefroy) #3

Thank you for your quick answer,

In your README file, you write :
'You can start a local Postfix SMTP server by using -e LOCAL_SMTP_SERVER=true"
this’s why the Postfix package is installed.

And in your run.sh file:
“if [ “$LOCAL_SMTP_SERVER” = “true” ]
then
echo “Starting SMTP server…”
postfix start
echo “…done”
fi”
This’s how Postfix is started.

So, if Postfix is never used, could use remove Postfix from the image?

Thanks.


(David AZOULAY) #4

I must admit I don’t remember this… I think this was implemented for a particular customer who needed this. I will check internally if it still makes sense.

Anyway I agree this should be isolated in a specialised image for this customer and removed from the default image.


(David AZOULAY) #5

Ok we have removed postfix from our default images so now there is only one possible process started in the container: Tomcat.

We have added some details in the readme file to explain what to do if you want to use this feature (with a disclaimer that says it is not a good idea to use it in production). See https://github.com/simplicitesoftware/docker/blob/master/README.md