Docker Community Forums

Share and learn in the Docker community.

MySQL service inside docker container not working in macOS Sierra 10.12.6

docker
build

(Xmarston) #1

I was forced to reinstall macOS Sierra because I was in the beta program for High Sierra and I get a serious crash so I downgraded the system.

This Dockerfile was working in High Sierra before the sudden crash of the system.

FROM ubuntu:16.04
MAINTAINER XXX version 0.0.1

# Prepare Debian environment
ENV DEBIAN_FRONTEND noninteractive
# we don't need an apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache

# ----------------------------
# Configure supervisor
# ----------------------------
RUN apt-get update > /dev/null 2>&1 && apt-get install -y supervisor > /dev/null 2>&1
RUN mkdir -p /var/log/supervisor
COPY files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

## Mysql
RUN apt-get install -y mysql-client > /dev/null 2>&1
#RUN debconf-set-selections <<< 'mysql-server mysql-server/root_password password 1234'
#RUN debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password 1234'
RUN echo 'mysql-server mysql-server/root_password password 1234' | debconf-set-selections
RUN echo 'mysql-server mysql-server/root_password_again password 1234' | debconf-set-selections
RUN apt-get -y install mysql-server > /dev/null 2>&1
RUN sed -i -e 's/127.0.0.1/0.0.0.0/g' /etc/mysql/mysql.conf.d/mysqld.cnf
RUN echo "sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE" >> /etc/mysql/mysql.conf.d/mysqld.cnf
RUN usermod -d /var/lib/mysql/ mysql
mys
ADD files/xxx.dump /tmp/xxx.dump
ADD files/mysql_xxx.sql /tmp/mysql_xxx.sql

RUN service mysql start && \
    mysql -uroot -p1234 < /tmp/mysql_xxx.sql

RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get clean

EXPOSE 3306

CMD ["/usr/bin/supervisord"]

Now, reinstalling all things I does not work, it always outputs the same error:

   ...fail!

To add some information, in the step where the Dockerfile stops I am starting the service to dump a database.

My system version is macOS Sierra 10.12.6 (16G29) and my Docker version is 17.06.2-ce-mac27 (19124). Any workaround for this problem?


(Garyamort) #2

Did you delete your disk image? If you did not wipe and reinstall from scratch, the built in docker disk image may be using the RAW format which was only supported under High Sierra. If you delete the physical file, it should be recreated using the cow format which will work in Sierra. I found the whole process of upgrading to High Sierra, getting the boot drive to format via the new file format, and getting my image switched to RAW difficult - so I expect going in reverse would be just as bad.