When installing Stack in a blank Xenial docker container, we get
FailedConnectionException2 "raw.githubusercontent.com" 443 True getProtocolByName: does not exist (no such protocol name: tcp)
As pointed out here, the reason for this is because the netbase package has not been installed on the system. It should be added to the .deb dependencies for Stack.