As Janus Bahs Jacquet notes in the comment section, there is no 'rule' governing the number of a noun used attributively. The topic has been covered various times on this site, including here:
When are attributive nouns plural?
And you will find many online discussions if you run a search on "attributive nouns singular or plural". For example, ThoughtCo's page Attributive Nouns in Grammar contains this quotation from Geoffrey Leech (co-author of A Communicative Grammar of English):
"It is normal that the first or attributive noun of a sequence will be
singular," says Geoffrey Leech. "Yet studies of recent English . . .
have noted the apparently increasing variety of formations with a
plural attributive noun" (Change in Contemporary English: A
Grammatical Study, 2010).
The following passages from two reference works add confirmation of this trend towards plurality. Practical English Usage by Michael Swan has a section on English variation and change. In the sub-section Some more examples of changes in modern English (p296) he states:
Plural noun modifiers are becoming more common. For example antiques
shop is now as common as antique shop, and drugs problem is
replacing drug problem.
Adding my own example: a Google search returns twice as many results for sports teacher as for sport teacher.
Merriam–Webster's Dictionary of English Usage (p145) discusses the issue with reference to the term awards banquet:
It seems that the norm has been to have singular nouns used as
attributives— billiards, for instance, even lost its -s to give
us billiard ball and billiard table. What seems to be a fairly
recent trend toward using plural attributives in contemporary English
has attracted some attention and raised a few eyebrows.
The entry goes on to list several plural attributives such as weapons system and communications technology. It continues:
Many of these combinations come from specialized fields of endeavor,
and the plural form seems to be chosen to differentiate the meaning of
the combination with the plural form from whatever the singular
attributive might connote. In a more general case, like that of awards
banquet, perhaps the intent is simply to stress plurality: more than
one award will be presented.