Closed iredmail closed 4 years ago
@lejmr @TitanFighter @oubayun
Maybe I do not understand something, but I do not see any problems keeping everything you need (including default_settings.conf
) inside your image (and update default_settings.conf
and the rest things and release a new image every time you need). You can build (read as: add any files to your image) the way you wish and then upload the image you built to docker hub.
Here is the little instruction how to build and push an image to Docker Hub.
Additionally you can check, for example, implementation of PostgreSQL (docker hub + git), because they also use some default env values.
docker-entrypoint.sh
file with your default values (or even import default_settings.conf
into docker-entrypoint.sh
).--env-file iredmail.conf
, ie: docker run --env-file iredmail.conf
-e
, ie: docker run -e HOSTNAME=mail.xyz.com -e FIRST_MAIL_DOMAIN=xyz.com
which, as a result, override your default env values.
Does it help?
Thanks for sharing. It’s a good idea, I will make it happen soon. :)
Hi, I am sorry for late response.
I totally agree with using env variables through -e or --env-file parameters. I can't even express how annoying is to push a config file into a container if you dont want to go with default variables.
The default_settings.conf
is a good idea, but that is going to be tricky to make sure the default values for such variables get overrode by -e/--env-file variables. Bear in mind that all variables pushed using -e/--env-file are visible among env variables (which get listed by env
bash command). Therefore, the easiest way is to list all variables from default_settings.conf
as ENV
steps of Dockerfile (which can be done by pre-commit hook in git).
Other (maybe a side comment) is to container builds from CI. You can use jenkins/travis/what-ever-ci-as-a-service then you can automate some tricks as generation of the aforementioned ENV
steps, etc. However, you won't get the label "Automatic build of iRedMail", e.g., https://hub.docker.com/r/lejmr/iredmail. Therefore, if you want to get this label on the docker hub then you must make sure the git repository works standalone hence you can just use command docker built -t name:tag .
in order to build container locally. Sure you can have multiple projects of the one git repository and define when the Dockerfile is located thus you can generate multiple containers from one git repo (basically what you are shooting for right now)
Dear all,
Thank you very much for sharing.
Latest git version packs default_settings.conf
to image directly.
Dear all,
I need some help here.
Currently we use GitHub repo to manage all files used to build docker image, so it's easy to store many files, especially two config files:
default_settings.conf
iredmail.conf
We store MANY parameters with their default values in
default_settings.conf
, like paths to mailboxes, ssl cert/key files, clamav database, also parameters used to enable or disable some features:Currently
default_settings.conf
is maintained by iRedMail Team, andiredmail.conf
should be maintained by user to override settings defined indefault_settings.conf
.If we offer docker image via the Docker Hub, user gets only one image, no
default_settings.conf
. It's not good to store all parameters iniredmail.conf
and ask users to add new ones or remove deprecated ones if there's some update, and user may make mistakes (quite often).So the question is: is there any easy way we can maintain the default settings, and let users just maintain customized ones?