Do not add hostname when networking is disabled

Fixes #3247

Docker-DCO-1.0-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)