I'm using `docker-compose` to set up a `Mariadb` database in a container and run a migration to get it ready for use. The issue is I'm getting an error of the following when doing so:

```
Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

```

This makes me think the database isn't set up at this point in the `Dockerfile` but I could be wrong. Any ideas?

`Dockerfile` contents:

```
FROM mariadb:10.0.37
ADD db /db
WORKDIR /db
RUN mysql --user userExample --password passwordExample < migrate.sql

```

`docker-compose.yaml` contents:

```
version: '3'
services:
  db:
    build: .
    environment:
      - MYSQL_USER=userExample
      - MYSQL_PASSWORD=passwordExample
    networks:
      example_network:
        ipv4_address: 172.28.1.1

networks:
  example_network:
    ipam:
      driver: default
      config:
        - subnet: 172.28.0.0/16

```