-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image
Description
Hi,
This line prevents my custom /docker-entrypoint-initdb.d/init.sh
from being run after container built. I need a way to run this script without removing the content of the data dir. What's the workaround for this issue? I don't want to send any request from other containers to MySQL container if it is not ready.
Thanks
Dockerfile
FROM mysql:5.7.24
COPY init.sh /docker-entrypoint-initdb.d/init.sh
RUN chmod +x /docker-entrypoint-initdb.d/init.sh
/docker-entrypoint-initdb.d/init.sh
#!/bin/sh
set -e
echo "Check DB!"
while ! MYSQL_PWD=custom_password mysqladmin -u custom_user ping -h localhost; do
echo "Wait ..."
sleep 1
done
echo "DB ready!"
Metadata
Metadata
Assignees
Labels
questionUsability question, not directly related to an error with the imageUsability question, not directly related to an error with the image