FROM ubuntu
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y mysql-server && \
apt-get install -y mysql-client
Then, I started a container, and ran:
/etc/init.d/mysql restart
Unfortunately, it didn't work:
root@5e37c0985d07:/opt# /etc/init.d/mysql restart * Stopping MySQL database server mysqld
[ OK ] * Starting MySQL database server mysqld
No directory, logging in with HOME=/ [fail]
Please note No directory, logging in with HOME in the error message.
Try usermod -d /var/lib/mysql mysql and then /etc/init.d/mysql restart
Try First to create an empty directory "mysql" at the host machine and then run the container with this directory path bind to the container directory path. Ex: docker run -i -t -p "3306:3306" -v ${PWD}/mysql:/var/lib/mysql "docker-image"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With