The damage is only for the hit you score with the blade
Booming Blade says:
You brandish the weapon used in the spell’s casting and make a melee attack with it against one creature within 5 feet of you. On a hit, the target suffers the weapon attack’s normal effects and then becomes sheathed in booming energy until the start of your next turn.
At Higher Levels. At 5th level, the melee attack deals an extra 1d8 thunder damage to the target on a hit,
The "On a hit" refers to the melee attack of the weapon used in the spell's casting, which is your weapon, as the spell has a range of self. The extra damage refers to that attack when it says "the melee attack", so that damage only applies to the damage you deal with that attack. (It does not even apply to other attacks you make, for example from the Extra Attack feature a fighter has).
The melee attack is not "a" melee attack. The text would need to be phrased very differently if as an extra effect, it would allow any attack to deal an additional d8 damage while the target is sheathed in energy.