dockerfile构建mysql镜像

使用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 
阅读 8.8k
2 个回答
新手上路,请多包涵

你好,请问你的dockerfile中写的关于my.cnf中的内容是啥呢?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题