|
|
<h1 id="docker10-实战-快速搭建wordpress" style="margin: 10px 0px; padding: 0px; list-style-type: none; list-style-image: none; font-size: 28px; line-height: 1.5; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><span style="font-size: 14px;">安装成功!</span><span style="font-family: Arial; font-size: 14px;"></span></h1><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"></p><div class="toc" style="color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><div class="toc-container-header">目录</div><ul style="margin: 0px 0px 0px 30px; padding: 0px; list-style: none;"><li style="margin: 0px; padding: 0px; list-style-type: disc; list-style-image: none;"><a href="https://www.cnblogs.com/itzixueba/p/13945628.html#docker10-实战-快速搭建wordpress" style="text-decoration-line: none; color: rgb(51, 153, 255);">Docker10-实战-快速搭建wordpress</a><ul style="margin: 0px 0px 0px 30px; padding: 0px; list-style: none;"><li style="margin: 0px; padding: 0px; list-style-type: circle; list-style-image: none;"><a href="https://www.cnblogs.com/itzixueba/p/13945628.html#wordpress介绍" style="text-decoration-line: none; color: rgb(51, 153, 255);">wordpress介绍</a></li><li style="margin: 0px; padding: 0px; list-style-type: circle; list-style-image: none;"><a href="https://www.cnblogs.com/itzixueba/p/13945628.html#传统方式搭建wordpress运行环境的弊端" style="text-decoration-line: none; color: rgb(51, 153, 255);">传统方式搭建wordpress运行环境的弊端</a></li><li style="margin: 0px; padding: 0px; list-style-type: circle; list-style-image: none;"><a href="https://www.cnblogs.com/itzixueba/p/13945628.html#使用docker快速构建wordpress" style="text-decoration-line: none; color: rgb(51, 153, 255);">使用Docker快速构建wordpress</a></li></ul></li></ul></div><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"></p><h2 id="wordpress介绍" style="margin: 10px 0px; padding: 0px; list-style-type: none; list-style-image: none; font-size: 21px; line-height: 1.5; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">wordpress介绍</h2><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">wordpress是使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。</p><h2 id="传统方式搭建wordpress运行环境的弊端" style="margin: 10px 0px; padding: 0px; list-style-type: none; list-style-image: none; font-size: 21px; line-height: 1.5; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">传统方式搭建wordpress运行环境的弊端</h2><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">需要安装大量的软件和配置,如Apache或nginx,PHP,集成Apache和PHP运行环境,安装MySQL</p><h2 id="使用docker快速构建wordpress" style="margin: 10px 0px; padding: 0px; list-style-type: none; list-style-image: none; font-size: 21px; line-height: 1.5; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">使用Docker快速构建wordpress</h2><ol style="margin: 0px 0px 0px 20px; padding: 0px 0px 0px 40px; list-style: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><li style="margin: 0px; padding: 0px; list-style-type: decimal; list-style-image: none;">下载wordpress镜像</li></ol><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; padding: 0px; list-style-type: none; list-style-image: none; font-family: "Courier New", Courier, monospace; color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);"><code class="hljs ruby" style="font-family: "Courier New", sans-serif; background: rgb(245, 245, 245); color: black; display: block; border: 1px solid rgb(204, 204, 204); padding: 5px; border-radius: 3px; overflow-x: auto; line-height: 1.5; margin: 0px;">root@ubuntu<span class="hljs-symbol" style="color: rgb(0, 176, 232);">:/home/guanfuchang</span><span class="hljs-comment" style="color: rgb(0, 128, 0);"># docker pull wordpress</span>
</code></pre><ol style="margin: 0px 0px 0px 20px; padding: 0px 0px 0px 40px; list-style: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><li style="margin: 0px; padding: 0px; list-style-type: decimal; list-style-image: none;">下载mysql镜像</li></ol><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; padding: 0px; list-style-type: none; list-style-image: none; font-family: "Courier New", Courier, monospace; color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);"><code class="hljs ruby" style="font-family: "Courier New", sans-serif; background: rgb(245, 245, 245); color: black; display: block; border: 1px solid rgb(204, 204, 204); padding: 5px; border-radius: 3px; overflow-x: auto; line-height: 1.5; margin: 0px;">root@ubuntu<span class="hljs-symbol" style="color: rgb(0, 176, 232);">:/home/guanfuchang</span><span class="hljs-comment" style="color: rgb(0, 128, 0);"># docker pull mysql:5.5</span>
</code></pre><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">3.安装运行mysql容器</p><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; padding: 0px; list-style-type: none; list-style-image: none; font-family: "Courier New", Courier, monospace; color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);"><code class="hljs apache" style="font-family: "Courier New", sans-serif; background: rgb(245, 245, 245); color: black; display: block; border: 1px solid rgb(204, 204, 204); padding: 5px; border-radius: 3px; overflow-x: auto; line-height: 1.5; margin: 0px;"><span class="hljs-attribute" style="color: rgb(163, 21, 21);">docker</span> run --name mysql -v /data/mysql-data:/var/lib/mysql -p <span class="hljs-number">3306</span>:<span class="hljs-number">3306</span> -e MYSQL_ROOT_PASSWORD=root -d mysql:<span class="hljs-number">5</span>.<span class="hljs-number">5</span>
</code></pre><ol style="margin: 0px 0px 0px 20px; padding: 0px 0px 0px 40px; list-style: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><li style="margin: 0px; padding: 0px; list-style-type: decimal; list-style-image: none;">安装运行wordpress容器</li></ol><pre style="overflow: auto; margin-top: 0px; margin-bottom: 0px; padding: 0px; list-style-type: none; list-style-image: none; font-family: "Courier New", Courier, monospace; color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);"><code class="hljs ruby" style="font-family: "Courier New", sans-serif; background: rgb(245, 245, 245); color: black; display: block; border: 1px solid rgb(204, 204, 204); padding: 5px; border-radius: 3px; overflow-x: auto; line-height: 1.5; margin: 0px;">root@ubuntu<span class="hljs-symbol" style="color: rgb(0, 176, 232);">:/home/guanfuchang</span><span class="hljs-comment" style="color: rgb(0, 128, 0);"># docker run -itd --name wordpress -e WORDPRESS_DB_HOST=mysql -e WORDPRESS_DB_PASSORD=root -p 8080:80 --link mysql:mysql -d wordpress</span>
</code></pre><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">访问主机的8080端口,如:<a href="http://192.168.147.128:8080/" target="_blank" style="text-decoration-line: none; color: rgb(51, 153, 255);">http://192.168.147.128:8080</a></p><p style="margin: 10px auto; padding: 0px; list-style-type: none; list-style-image: none; color: rgb(68, 68, 68); font-family: Tahoma, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"><img src="https://gitee.com/zykit/images/raw/master/img/604717-20190508135115344-959485884.png" alt="img" loading="lazy" style="border-width: initial; border-style: none; max-width: 100%; margin-top: 10px; margin-bottom: 10px; height: auto;" /></p> |
|