# 目前还有问题,还未解决,希望这几天能够解决 [22:37:10 root@centos7 mysql]#ll total 853496 -rw-r--r-- 1 root root 852 Jun 21 22:27 Dockerfile -rw-r--r-- 1 root root 338 Jun 21 21:42 my.cnf -rw-r--r-- 1 root root 873967604 Jun 14 18:23 mysql-8.0.23-linux-glibc2.12-x86_64.tar.xz -rw-r--r-- 1 root root 32 Jun 21 21:56 mysql.sh [22:38:13 root@centos7 mysql]#cat Dockerfile FROM centos:7 LABEL <noise@admin.com> noiseLys RUN yum -y install vim-enhanced tcpdump lrzsz tree telnet bashcompletion net-tools wget bzip2 lsof tmux man-pages zip unzip nfs-utils gcc make gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel RUN groupadd mysql RUN useradd -r -g mysql -s /bin/false mysql ADD mysql-8.0.23-linux-glibc2.12-x86_64.tar.xz /usr/local/ RUN cd /usr/local/ && ln -s mysql-8.0.23-linux-glibc2.12-x86_64/ mysql && chown -R root.root /usr/local/mysql/ && \ mkdir -pv /data/mysql/logbin/ ADD mysql.sh /etc/profile.d/ RUN . /etc/profile.d/mysql.sh ADD my.cnf /etc/ CMD [‘mysqld‘,‘--initialize-insecure‘,‘--user=mysql‘,‘--datadir=/data/mysql‘] RUN cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld CMD ["chkconfig","--add","mysqld"] CMD ["service","mysqld","start"] [22:38:27 root@centos7 mysql]#cat my.cnf [mysqld] dir=/data/mysql skip_name_resolve=1 socket=/data/mysql/mysql.sock explicit_defaults_for_timestamp=true log_bin=/data/mysql/logbin/mysql-binlog log-error=/data/mysql/mysql.log pid-file=/data/mysql/mysql.pid log_timestamps=SYSTEM server-id=1 [client] socket=/data/mysql/mysql.sock [mysql] prompt="\\r:\\m:\\s(\\u@\\h) [\\d]>\\_" [22:38:31 root@centos7 mysql]#cat mysql.sh PATH=/usr/local/mysql/bin:$PATH