Attempting equivalent of mysql_secure_installation

This commit is contained in:
WilliamMiceli
2019-11-22 22:13:05 -05:00
parent e93f966b86
commit 12c609cade

View File

@@ -17,8 +17,13 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
COPY /etc/ /etc/
# Setting up MySQL --Will come back to later, as it's not necessary and not playing very well with automation
RUN echo -e "\ny\nPassword1234\nPassword1234\ny\ny\ny\ny" | mysql_secure_installation
RUN mysql -u root <<-EOF
UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;
EOF
# Copying in startup script
COPY /entrypoint.sh /