Does Docker images works without client application
When you download mariadb image, mysql client tool is only available inside container. It is not getting magically installed on your local - that is why you had to install mysql client app.

Alternative way to connect to db without installing mysql app is to use docker exec and through this get to mysql tool available on container. So you would do something like:

docker exec -it your_maria_db_container_id mysql -h localhost -u root -p


Hope this helps.