Load from env should only happen if the value is unset.
Extract a buildEnvironment function and revert some changes to tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a9c86b63c03fc3557748d7792c11041387cb93d9
Component: engine