Why do the dragons attack me?
From a point of view of the senario, you are the child of Dragon. So you are the only one to face Alduin (their leader), you are somehow enemies sworn.
As you are his enemy, the other dragons being on his side attack you as soon as they see you.
And even after facing him in Sovngarde, some Dragon stays on his side and attacks you again.
Noted that you also have to take into account that the Dragon likes to face powerful opponents as Dovahkiin, you are best placed to face them in duels.
TLDR: You're made of meat.
While you are The Dragonborn, a special snowflake & all that, the premise of the question is off base and thus so are most of the other answers.
The dragons aren't attacking you in particular. They're intelligent apex predators who embrace the idea that "Might makes right". Give 'em a break! They've been dead for centuries. It's been a while since they've last eaten. Given sufficient cover & stealth skills, you can get away from a dragon while it ravages the area's wildlife/giants/bandits/guards/citizens. (You filthy coward!)
Yes, you are Dovahkiin, and can consume the soul of a defeated dov (dragon) exactly like any other dov. You still have a weak human/mer/beastman body and a toddler's Thu'um vocabulary, so, with one notable exception who has embraced The Way of the Voice, you need to earn their respect. Which does happen a few times. So while the other mortals may think you're "all that", let's be honest, Dragons seldom notice you as anything more than a rack of ribs on two feet.
FWIW: 2 of the dragons that give you their respect give you their names to add to your list of shouts. The 3rd dragon to betray his former master doesn't live long after his service to you.
They are immortal, except when you're around.
You are not just powerful. You're THE person that can permanently destroy them by absorbing their souls.
They don't like you very much because of this.
Doing the main storyline actually answers this, so some spoilers are inevitable:
It turns out you are The Dragonborn, a mortal born every now and then with a dragon's soul and the ability to absorb the souls of other dragons.
Normally, when a dragon is physically killed, their soul simply escapes and reforms a body at a later time, so from their perspective, being killed is at worst an inconveniently timed forced nap. Annoying if they were in the middle of something, but no big. If they're killed while you're around, however, death is much more permanent, and they don't like that.
The only reasonable solution, from the perspective of most of them, is to kill you before you get the chance to do it to them.