Troubleshooting docker network issues can be a bit tricky, especially if your container is minimal (as it should be). If you don’t want to install ping
then you can do the following:
(echo >/dev/tcp/{HOST}/{PORT}) &>/dev/null && echo "open" || echo "closed"
If you can’t connect with the hostname, remember to try with a FQDN or an IP to rule out DNS issues.
Pretty fancy!