'If environment files are combined with explicit environment variables, the explicit environment variables will override the key from the env file.'

def get_environment(self, env, env_file):

    final_env = {}
    if env_file:
        self.ensure_capability('env_file')
        parsed_env_file = docker.utils.parse_env_file(env_file)
        for (name, value) in parsed_env_file.items():
            final_env[name] = str(value)
    if env:
        for (name, value) in env.items():
            final_env[name] = str(value)
    return final_env
