diff --git a/8.0/Dockerfile b/8.0/Dockerfile index b7a601a42..d60f039d6 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -1,5 +1,4 @@ FROM debian:jessie - # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r mysql && useradd -r -g mysql mysql @@ -54,19 +53,15 @@ RUN { \ echo mysql-community-server mysql-community-server/re-root-pass password ''; \ echo mysql-community-server mysql-community-server/remove-test-db select false; \ } | debconf-set-selections \ - && apt-get update && apt-get install -y mysql-server="${MYSQL_VERSION}" && rm -rf /var/lib/apt/lists/* \ + && apt-get update && apt-get install -y mysql-community-client-core="${MYSQL_VERSION}" mysql-community-server-core="${MYSQL_VERSION}" && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ # ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime && chmod 777 /var/run/mysqld -# comment out a few problematic configuration values -# don't reverse lookup hostnames, they are usually another container -RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/mysql.conf.d/mysqld.cnf \ - && echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf - VOLUME /var/lib/mysql - +# Config files +COPY config/ /etc/mysql/ COPY docker-entrypoint.sh /usr/local/bin/ RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/8.0/config/conf.d/docker.cnf b/8.0/config/conf.d/docker.cnf new file mode 100644 index 000000000..4f1829d66 --- /dev/null +++ b/8.0/config/conf.d/docker.cnf @@ -0,0 +1,3 @@ +[mysqld] +skip-host-cache +skip-name-resolve diff --git a/8.0/config/my.cnf b/8.0/config/my.cnf new file mode 100644 index 000000000..e9f2eda42 --- /dev/null +++ b/8.0/config/my.cnf @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysqld] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +secure-file-priv= NULL +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +# Custom config should go here +!includedir /etc/mysql/conf.d/