Accessing host machine from within docker container

Can you use environment variables for that matter? You can write any host information (the host ip) in a variable and pass it to the container the moment you run it.