0

I have the weirdest case I have ever seen. It's my first time trying Docker and I know some stuff I do are not the best patterns but basically I'm trying to create a Docker container that contains all the different services we need to run one of our application.

This means :

  • Java
  • Thrift
  • Mongo
  • Mysql
  • ElasticSearch

What I did is that I've created a first image with Java and thrift based on the Ubuntu 16.04 image. This was working well. Then from the newly created image I created a new image adding the Mongo service This was working fine to.

And finally, that's where I'm stuck, I created a new image base on the java-mongo image that installs mysql-server.

The dockerfile is pretty simple :

FROM base-java-mongo

MAINTAINER  Thoma Biguères <>

RUN wget http://repo.mysql.com/mysql-apt-config_0.8.9-1_all.deb RUN dpkg -i mysql-apt-config_0.8.9-1_all.deb RUN apt-get update ENV MYSQL_PWD root_password RUN echo "mysql-server mysql-server/root_password password $MYSQL_PWD" | debconf-set-selections RUN echo "mysql-server mysql-server/root_password_again password $MYSQL_PWD" | debconf-set-selections

RUN apt-get install -y mysql-server

#set correct home for mysql user RUN usermod -d /var/lib/mysql/ mysql RUN mkdir /var/run/mysqld RUN chown -R -v mysql:mysql /var/lib/mysql /var/run/mysqld && \
    service mysql start

EXPOSE 3306 33060

When I build the image everything looks like its working. When I run a new container based on the MySQL image I have issues launching MySQL.

The issue from the log is the following :

2019-04-04T14:17:29.380269Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table storage engine for 'user' doesn't have this option
2019-04-04T14:17:29.380398Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2019-04-04T14:17:29.380519Z 0 [ERROR] Aborting

By doing some research it looked like a chown issue, so I added it into my dockerfile.

And that's when weird thing happens : If I bash into the container and check the rights it looks like everything worked and everything has the correct owner mysql:mysql. But then if I try to start the service the error appears again. If I do the same command again and try to start MySQL service then it works !

You can check it here it might be clearer with a video.

I tried chown with -v and -c and it basically tells me that nothing changes.

Have you any idea where this can come from ? Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.