Generate environment variables from links.

Fixes #91.
I guess I misread the order of substitutions, when reading the corresponding docker source. I suspect most things will be happy with hostnames instead of addresses, so resolving them is something that can happen in a separate ticket.