title: mysql file not found in $PATH error using Docker and Django?
body: <p>I'm working on using Django and Docker with MariaDB on Mac OS X.</p>
  <p>I'm trying to grant privileges to Django to set up a test db. For this, I have a script that executes this code, <code>sudo docker exec -it $container mysql -u root -p</code>. When I do this after spinning up, instead of the prompt for the password for the database, I get this error message,</p>
  <blockquote>
  <p>OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: &quot;mysql&quot;: executable file not found in $PATH: unknown</p>
  </blockquote>
  <p>On an Ubuntu machine, I can delete the data folder for the database and spin up, spin down, and run the command without the error, but on my Mac, which is my primary machine that I'd like to use, this fix doesn't work. Any ideas? I've had a peer pull code and try it on their Mac and it does the same thing to them! Docker is magic to me.</p>
  <p>Here's my docker-compose.yml.</p>
  <pre><code>version: &quot;3.3&quot;
  
  networks:
    django_db_net:
      external: false
  
  services:
    django:
      build: ./docker/django
      restart: 'unless-stopped'
      depends_on:
        - db
      networks:
        - django_db_net
      user: &quot;${HOST_USER_ID}:${HOST_GROUP_ID}&quot;
      volumes:
        - ./src:/src
      working_dir: /src/vger
      command: [&quot;/src/wait-for-it.sh&quot;, &quot;db:3306&quot;, &quot;--&quot;, &quot;python&quot;, &quot;manage.py&quot;, &quot;runserver&quot;, &quot;0.0.0.0:8000&quot;]
  
      ports:
        - &quot;${DJANGO_PORT}:8000&quot;
  
    db:
      image: mariadb:latest
      user: &quot;${HOST_USER_ID}:${HOST_GROUP_ID}&quot;
      volumes:
        - ./data:/var/lib/mysql
      restart: always
      environment:
        - MYSQL_ROOT_PASSWORD=this_is_a_bad_password
        - MYSQL_USER=django
        - MYSQL_PASSWORD=django
        - MYSQL_DATABASE=vger
      networks:
        - django_db_net
  </code></pre>
  <p>And my Dockerfile</p>
  <pre><code>FROM python:latest
  
  ENV PYTHONUNBUFFERED=1
  RUN pip3 install --upgrade pip &amp; \
    pip3 install django mysqlclient
  ENV MYSQL_MAJOR 8.0
  RUN apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 8C718D3B5072E1F5 &amp; \
    echo &quot;deb http://repo.mysql.com/apt/debian/ buster mysql-${MYSQL_MAJOR}&quot; &gt; /etc/apt/sources.list.d/mysql.list &amp; apt-get update &amp; \
    apt-get -y --no-install-recommends install default-libmysqlclient-dev
  WORKDIR /src
  </code></pre>