Browse Source

Merge pull request '修改作业3运行命令,未标明环境变量' (#6) from 10205501411/cloud-computing-course:master into master

Reviewed-on: https://gitea.shuishan.net.cn/xslu_dase_ecnu_edu_cn/cloud-computing-course/pulls/6
master
陆雪松 1 year ago
parent
commit
c1a2311a69
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      Assignment4.md

+ 1
- 1
Assignment4.md View File

@ -203,7 +203,7 @@ sudo docker pull cloud_computing/wordpress
#### 2)运行wordpress的docker镜像,并将container的80和433端口暴露给云主机
```
sudo docker run --rm -d -p 80:80 -p 443:443 --name myWordpress -e WORDPRESS_DB_HOST=10.23.243.194:3306 -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=mysql123 WORDPRESS_DB_NAME=mysql wordpress
sudo docker run --rm -d -p 80:80 -p 443:443 --name myWordpress -e WORDPRESS_DB_HOST=10.23.243.194:3306 -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=mysql123 -e WORDPRESS_DB_NAME=mysql wordpress
```
> 回顾docker run语法,--rm container停止运行时自动删除,-d 以Detached模式运行container,-p 80:80 将container的80端口映射到云主机的80端口,--name为container取名(myWordpress),最后一个wordpress是镜像名。

Loading…
Cancel
Save