热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

docker环境怎么安装WordPress

docker环境安装WordPress的方法:首先通过docker命令行创建一个mariadb数据库;然后通过命令下载WordPress;接着使用命令查看IP;最后使用浏览器打开此IP地址,即可访问后台安装程序进行安装。

docker环境安装WordPress:

1、先安装docker环境

打开命令行, 复制并执行.

执行命令:

docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb

执行过程中的代码如下:

$ docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb
Unable to find image 'mariadb:latest' locally
latest: Pulling from library/mariadb
cd0a524342ef: Pull complete
d9c95f06c17e: Pull complete
46b2d578f59a: Pull complete
10fbc2bcc6e9: Pull complete
c5b600f068c4: Pull complete
4bca4fbb56d8: Pull complete
b9e6f929873a: Pull complete
d6a107bfa79e: Pull complete
535efcd897c3: Pull complete
73201af09173: Pull complete
cfe3cdae1993: Pull complete
69f22759c937: Pull complete
Digest: sha256:7cf3822d4582d5d0d95c2512ea6b5d2d4bdb4b299ce7ed67cb5c84df081cf14c
Status: Downloaded newer image for mariadb:latest
3ccdd915760f9935505f997e7820501f497f17570cb23a2e4d33f8325c84603b

解释一下上面的代码:

使用docker命令创建一个mariadb数据库. 并指定密码.

2、开始安装WordPress, 执行以下的命令:

docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress

执行的过程为:

$ docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress
Unable to find image 'wordpress:latest' locally
latest: Pulling from library/wordpress
cd0a524342ef: Already exists
14b8a88a0af0: Pull complete
d78c922dd678: Pull complete
6680e61553d3: Pull complete
df1ddb74fbec: Pull complete
048af0e09526: Pull complete
d11ab6756039: Pull complete
8b684f7dda23: Pull complete
206854c69eb7: Pull complete
b7e643dc9b09: Pull complete
b9503d4d2386: Pull complete
f31ae3e5fa86: Pull complete
44fd64f7b16f: Pull complete
0b10d49f9584: Pull complete
a59a3f4f432b: Pull complete
d5fad60b1fb1: Pull complete
6762d0157c35: Pull complete
08dc92905b0e: Pull complete
Digest: sha256:dc77678ddced9623331e051e1b192ee76f887fd683b9ede2f718a6bc4eb08ea6
Status: Downloaded newer image for wordpress:latest
e50397d0b22acb3e3d14a0cdcd7ae048d61870c195934c2d6172e8f5b2cf3a74

下载的过程可能会有些稍慢, 耐心等待下载完成. 等待下载完成, WordPress 就安装完成了.

可以使用 docker-machine ip 查看ip. 然后, 使用浏览器打开对应的ip地址, 就可以直接访问了. 我这里的ip是: 192.168.1.100

使用该地址

http://192.168.99.100:8080/wp-admin/install.php 可以直接访问后台安装程序. 进行WordPress的安装.

安装过程:

1、选择语言为简体中文:

更多wordpress相关技术文章,请访问wordpress教程栏目进行学习!

以上就是docker环境怎么安装WordPress的详细内容,更多请关注其它相关文章!


推荐阅读
author-avatar
ai琳伟_261
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有