Docker Community Forums

Share and learn in the Docker community.

Mysql container can not run

docker

(Denizguzel) #1

Hi everybody,
I want to make my own mysql container from mysql image. But mysql container can not run.
My Dockerfile;

FROM mysql

ENV MYSQL_ROOT_PASSWORD=pass

RUN mkdir /usr/sql

RUN chmod 644 /usr/sql

ADD Tedam_Master.sql /usr/sql/

ADD restoredb.sh /usr/sql/

ADD entrypoint.sh /usr/sql

RUN chmod +x /usr/sql/restoredb.sh

RUN chmod +x /usr/sql/entrypoint.sh

EXPOSE 3306

WORKDIR /usr/sql/

ENTRYPOINT entrypoint.sh

entypoint.sh;
/ usr/sql/restoredb.sh && /etc/init.d/mysql start
restoredb.sh;
sleep 10s
echo “Starting database import!”
mysql -u root -p$MYSQL_ROOT_PASSWORD -e “CREATE DATABASE mydb”
mysql -u root -p$MYSQL_ROOT_PASSWORD -D mydb< /usr/sql/Tedam_Master.sql

Who can help me?


(Denizguzel) #2

Anyone didn’t help me. How can I do? At the same time I cannot run mysql and database restore.


(Chcornwell) #3

Have you checked to make sure that your ENTRYPOINT script is not masking a script defined in the source MySQL image?