Dockerfile-mysql 系统管理员 2022-07-19 01:13 107阅读 0赞 ## 1. ## FROM centos:centos6 MAINTAINER "gmaid@gmail.com" RUN yum install -y mysql-server mysql RUN /etc/init.d/mysqld start &&\ mysql -e "grant all privileges on *.* to 'root'@'%' identified by 'mima';"&&\ mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by '123#456';"&&\ mysql -u root -p123#456 -e "show databases;" EXPOSE 3306 CMD ["/usr/bin/mysqld_safe"] ## 2 docker pull mysql:5.6 ## docker run --name db001 --restart=always -v /docker/mysql/db1:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=passwd -d mysql:5.6
还没有评论,来说两句吧...