title: Cannot run docker container with non root user for mariadb image
body: <p>Without a non root user the docker container that is running out of the dockerfile is working without error but when I add a user then I am getting following error:</p>
  
  <pre><code>    Initializing database 2019-07-17 21:28:05 0 [Warning] Can't create test file /var/lib/mysql/9e79cb48a1f0.lower-test 2019-07-17 21:28:05 0 [ERROR] mysqld: Can't create/write to file '/var/lib/mysql/aria_log_control' (Errcode: 13 "Permission denied") 2019-07-17 21:28:05 0 [ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '/var/lib/mysql/aria_log_control' 2019-07-17 21:28:05 0 [ERROR] Plugin 'Aria' init function returned error. 2019-07-17 21:28:05 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. 2019-07-17 21:28:05 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2019-07-17 21:28:05 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. 2019-07-17 21:28:05 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2019-07-17 21:28:05 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. 2019-07-17 21:28:05 0 [ERROR] InnoDB: Cannot open datafile './ibdata1' 2019-07-17 21:28:05 0
   [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
  </code></pre>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM mariadb:10.3.5
  
  RUN apt-get update &amp; apt-get upgrade -y
  
  ENV MYSQL_USER=user1 \
      MYSQL_PASSWORD=pass5 \
      MYSQL_DATABASE=db \
      MYSQL_ROOT_PASSWORD=XXX
  
  
  
  RUN useradd -ms /bin/bash newuser
  USER newuser
  WORKDIR /home/newuser
  RUN sudo chown -R newuser:newuser /var/lib/mysql
  ADD . /home/newuser
  
  I would like to see the container to run as non root user
  </code></pre>