1. 拉取centos镜像
docker search centos
docker pull centos :centos7
2.运行镜像将容器跑起来
docker run -d -it -p 10.20.10.153:83:80 --privileged centos:centos7 /usr/sbin/init
注意:端口映射、httpd.service服务注册
3.进入容器
4. yum install httpd
5. 将前端代码frond_end.tar.gz 解压到/var/www/html目录下 httpd.conf配置文件documentroot
的默认目录
注意:查看解压的文件是否正确解压和路径权限够不够
6.不要修改http.conf默认配置
7.启动httpd服务
systemctl start httpd.service
systemctl status httpd.service -l 查看服务状态是否正常启动
8.本地访问宿主机 10.20.10.153:83 verify网站是否正常能访问
/var/log/httpd/error_log
数据库容器启动
docker run -itd --name uphmp-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
reference:https://www.runoob.com/docker/docker-install-mysql.html