Skip to content

Instantly share code, notes, and snippets.

@ihor-lev
Forked from feltnerm/Dockerfile
Created December 14, 2022 10:02
Show Gist options
  • Save ihor-lev/808220a646e1c25d4f7d169c3e71c8be to your computer and use it in GitHub Desktop.
Save ihor-lev/808220a646e1c25d4f7d169c3e71c8be to your computer and use it in GitHub Desktop.
Docker + MySQL + `lower_case_table_names=1`
# Build the base image
docker build -t widen/db .
# Run the container
docker run --name $container_name --net=host \
-e MYSQL_USER=$mysql_user \
-e MYSQL_PASSWORD=$mysql_password \
-e MYSQL_DATABASE=$mysql_database \
-e MYSQL_ROOT_PASSWORD=$mysql_root_password \
-d widen/db
# Import SQL
mysql --user=$user --password=$pass --host=$HOST $db < $sql_dump
FROM mysql
ADD my.cnf /etc/mysql/my.cnf
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mysql"]
[mysqld]
bind-address=0.0.0.0
# http://www.percona.com/blog/2008/05/31/dns-achilles-heel-mysql-installation/
skip_name_resolve
general_log_file = /var/lib/mysql.log
general_log = 1
lower_case_table_names = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment