Comments - Using environment variables to create user@localhost
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
I'm not sure what you are missing out without a user@localhost as shown above a user @% user can log in on the unix socket.
The only way is to create other users is with SQL in /docker-entrypoint-initdb.d during startup like you suggested.