When running a container with docker run you can pass environment variables using the -e flag.
-e
docker run -e VAR=foo <image>
Docs