#基于 ubuntu 最新版镜像
FROM ubuntu:latest
#更新安装包列表
RUN apt update
#安装 apache2
RUN apt install apache2
#安装 mysql-server
RUN apt install mysql-server
#启动 mysql
RUN service mysql start
#登陆 mysql
RUN mysql
#修改 root 密码
RUN alter user “root”@“localhost” identified with mysql_native_password by “12345”;
#root 密码生效
RUN flush privileges ;
#新建数据库
RUN create database wordoress ;
#新建用户
RUN create user “solve”@“localhost” identufied by “888888”;
#配置数据库用户
RUN grant all on wordpress.* to “slove”@“localhost” with grant option ;
#配置生效
RUN flush privileges ;
#退出数据库
RUN exit
#下载 wordpress 最新版到指定 /var/www/html/
ADD https://cn.wordpress.org/latest-zh_CN.tar.gz /var/www/html
#开放端口号
EXPOSE 80
CMD
FROM ubuntu:latest
#更新安装包列表
RUN apt update
#安装 apache2
RUN apt install apache2
#安装 mysql-server
RUN apt install mysql-server
#启动 mysql
RUN service mysql start
#登陆 mysql
RUN mysql
#修改 root 密码
RUN alter user “root”@“localhost” identified with mysql_native_password by “12345”;
#root 密码生效
RUN flush privileges ;
#新建数据库
RUN create database wordoress ;
#新建用户
RUN create user “solve”@“localhost” identufied by “888888”;
#配置数据库用户
RUN grant all on wordpress.* to “slove”@“localhost” with grant option ;
#配置生效
RUN flush privileges ;
#退出数据库
RUN exit
#下载 wordpress 最新版到指定 /var/www/html/
ADD https://cn.wordpress.org/latest-zh_CN.tar.gz /var/www/html
#开放端口号
EXPOSE 80
CMD
