I finally found the solution, and I feel ashamed to inform you that it was caused by the case I used for my environment variables. Indeed, the mendix build pack is very case sensitive.
Anyway, I share my experience of my journey, with the exemple of the constant EncryptionKey from the markeplace module Encryption (Encryption.EncryptionKey) :
- the environment variable must be MX_Encryption_EncryptionKey (not fully uppercase as I did)
- inject it in your docker run command or in your docker-compose file
- when the container starts, the script runtime.py (from cf-mendix-buildpack used by docker-mendix-buildpack) turns the environment variables starting with MX_ prefix, into Mendix Constants.
- a very convenient way to debug is to run your docker container with the environment variable BUILDPACK_XTRACE set to true. You will see the environment variables you set and the Mendix constants computed values in the DEBUG traces at startup.
I hope it will help someone!