AWS Fargate hostname not doable?
This is a known issue in the ecs agent. Have you tried this as a workaround:
echo "$(ip a | grep -A2 eth1 | grep inet | awk '{print $2}' | sed 's#/.*##g' ) $(hostname)" >> /etc/hosts
You can grab the ip and modify /etc/host during the entry point in your container.
I believe there is an ecs agent fix on its way, but I cannot find the issue on GitHub.