How can I use environment values when docker builds?

I have some setting values in which I get from env. In a separate file, I used the setting’s value in some functions for third-party packages. But, docker can’t get the env values on image build. Is there any way so that I can use the env values when docker builds. Otherwise, the docker builds will fail.

You should make make env vars in the settings file optional, for those which are not mandatory. You can send placeholder value through config section of heroku.yml file.