Docker creates a mirror that supports the MySQL service

Source: Internet
Author: User

#本地已有镜像FROM  docker.io/centos# Author Information maintainer liangyj  "[email protected]" #安装依赖工具RUN  yum  install -y gcc gcc-c++ make autoconf ncurses-devel# Download cmkaeadd    /usr/local/src# Compiling and installing Cmakeworkdir /usr/local/srcrun tar xzvf cmake-3.0.2.tar.gzworkdir  /usr/local/src/cmake-3.0.2run ./bootstraprun makerun make install# adding local MySQL to the container add  ./mysql-5.6.21.tar.gz /usr/local/src# creating MySQL Users and directories run mkdir -p /usr/local/mysql/ Datarun groupadd mysqlrun useradd -g mysql -s /sbin/nologin mysqlrun  chown -r mysql:mysql /usr/local/mysql# Compiling and installing mysqlworkdir /usr/local/src/ mysql-5.6.21run ["CMake", "-dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/ data -dsysconfdir=/etc -dwith_myisam_storage_engine=1 -dwith_innobase_storage_engine=1 - dwith_memory_storage_engine=1 -dWith_readline=1 -dmysql_unix_addr=/var/lib/mysql/mysql.sock -dmysql_tcp_port=3306 -denabled_ Local_infile=1 -dextra_charsets=all -ddefault_charset=utf8 -ddefault_collation=utf8_general_ci " ]run ["make"]run ["make", "Install"] #初始化数据库RUN  /usr/local/mysql/scripts/mysql_install_db -- datadir=/usr/local/mysql/data --basedir=/usr/local/mysql --user=mysql# Adding a startup script run cp /usr/ local/mysql/support-files/mysql.server /etc/init.d/mysqldrun chmod +x /etc/init.d/mysqld# Exposing port expose 3306# Modify pathrun sed -i  ' $ a export path=/usr/local/mysql/bin:$ PATH '  /etc/profilerun source /etc/profileworkdir /#删除cmake  mysql source Package and unpacking package RUN RM  -rf /usr/local/src/cmake-3.0.2.tar.gzRUN rm -rf /usr/local/src/cmake-3.0.2RUN  rm -rf /usr/local/src/mysql-5.6.21


This article is from the "Ubuntu" blog, so be sure to keep this source http://thankinglove.blog.51cto.com/2311485/1794986

Docker creates a mirror that supports the MySQL service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.