Docker分离部署MySQL、Nginx+Tomcat复制共享
2018-06-08 18:11 更新
from docker.io
/centos
:centos6
add cmake-2.8.12
/cmake-2
.8.12
add mysql-5.5.38
/mysql-5
.5.38
run yum -y
install
ncurses-devel gcc gcc-c++
run
cd
/cmake-2
.8.12 && .
/configure
&& gmake && gmake
install
run
cd
/mysql-5
.5.38 && cmake -DCMAKE_INSTALL_PREFIX=
/mysql
-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-DWITH_EXTRA_CHARSETS=all -SYSCONFDIR=
/etc
&&
make
&&
make
install
run
rm
-rf
/etc/my
.cnf
run
cp
/mysql-5
.5.38
/support-files/my-medium
.cnf
/etc/my
.cnf
run
cp
/mysql-5
.5.38
/support-files/mysql
.server
/mysqld
run
chmod
777
/mysqld
run groupadd mysql
run
useradd
-M -s
/sbin/nologin
mysql -g mysql
run
chown
-R mysql:mysql
/mysql
run
/mysql/scripts/mysql_install_db
--user=mysql --basedir=
/mysql/
--datadir=
/mysql/data/
run .
/mysqld
start &&
cd
/mysql/bin
&&
echo
"grant all privileges on *.* to
'root'
@
'%.%.%.%'
identified by
'123456'
;
" | ./mysql -u root && echo "
create database javatest;
" | ./mysql -u root && echo "
create table javatest.yw(
id
int);" | .
/mysql
-u root
cmd
cd
/mysql/bin
&& .
/mysqld_safe
以上内容是否对您有帮助:
更多建议: