Running the command "direnv allow" while building Docker

I am trying to build docker using a Dockerfile. While building, I am not able to run the command: direnv allow
‘direnv’ is package, which can read environment variables from .envrc file. I gave the following in Dockerfile to run direnv:

RUN direnv allow

Can anyone please tell me, how can we run direnv, while building docker image?