This command works as expected and returns the rate limit of 100.
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=reposit