February 7 2018

mysql 5.7 dockerfile

FROM centos

RUN groupadd -g 510 dba
RUN useradd -u 509 -d /home/mysql -g dba mysql
RUN yum install -y net-tools
RUN mkdir -p /u01/my3306/{data,log,run,tmp}
RUN mkdir -p /u01/mysql
RUN chmod -R 775 /u01/
RUN chown -R mysql.dba /u01
RUN yum -y install gcc gcc-c++ gcc-g77 kernel-devel autoconf automake make cmake perl ncurses-devel libmcrypt* libtool-ltdl-devel* readline-devel pcre-devel openssl-devel openssl
COPY boost_1_59.tar.gz /opt/boost_1_59.tar.gz
COPY b.tar /opt/b.tar
COPY mysql-5.7.11.tar.gz /opt/mysql-5.7.11.tar.gz
RUN tar -zvxf /opt/boost_1_59.tar.gz
RUN tar -zvxf ./opt/mysql-5.7.11.tar.gz
RUN cd mysql-5.7.11/ && cmake -DCMAKE_INSTALL_PREFIX=/u01/mysql -DMYSQL_DATADIR=/u01/my3306 -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/boost_1_59_0 && make && make install
COPY my.cnf /opt/my.cnf
RUN tar -zxvf /opt/b.tar -C /usr/local/bin
COPY supervisord.sh /u01/
RUN chmod 755 /u01/supervisord.sh
ENTRYPOINT [“/u01/supervisord.sh”]
ENV port=3306
ENV report_host=127.0.0.1
ENV report_port=3306
ENV LANG=en_US.UTF-8



Copyright 2019. All rights reserved.

Posted 2018年2月7日 by ucjmh in category "mysql

Leave a Reply

Your email address will not be published. Required fields are marked *