使用dockerfile构建mysql,镜像构建完成后,运行容器后,启动mysql服务总是报错
Fatal error: Can't open and lock privilege tables: Table storage engine for 'db' doesn't have this option
mysql安装使用的官方的压缩包
mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz
dockerfile代码如下:
# To build the images, exec the command below at the same directory
# docker build -t registry.cn-hangzhou.aliyuncs.com/lovekun/ubuntu-16.04:mysql-5.7.20 .
# Version mysql-5.7.20
# start server with the command bin/mysqld_safe --user=root &
FROM registry.cn-hangzhou.aliyuncs.com/lovekun/ubuntu-16.04:1.0.0
MAINTAINER qiuaikun@gmail.com
COPY mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz /usr/local
RUN apt-get -y update \
&& apt-get -y install libaio1 \
&& apt-get -y install numactl \
&& cd /usr/local \
&& tar -zxvf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz \
&& ln -s /usr/local/mysql-5.7.20-linux-glibc2.12-x86_64 mysql
ENV PATH $PATH:/usr/local/mysql/bin
COPY my.cnf /usr/local/mysql
RUN cd /usr/local/mysql \
&& bin/mysqld --defaults-file=/usr/local/mysql/my.cnf --initialize-insecure --user=root
建议使用官方镜像,或者mariadb可能是更好的选择
https://store.docker.com/imag...