diff --git a/2014/12/24/MFC 模态对话框/index.html b/2014/12/24/MFC 模态对话框/index.html index 44adc96770..9656611f35 100644 --- a/2014/12/24/MFC 模态对话框/index.html +++ b/2014/12/24/MFC 模态对话框/index.html @@ -308,16 +308,16 @@ diff --git a/2014/12/30/Clone-Graph-Part-I/index.html b/2014/12/30/Clone-Graph-Part-I/index.html index e2daba395c..cb33640f44 100644 --- a/2014/12/30/Clone-Graph-Part-I/index.html +++ b/2014/12/30/Clone-Graph-Part-I/index.html @@ -307,7 +307,7 @@ diff --git a/2015/03/11/Number-Of-1-Bits/index.html b/2015/03/11/Number-Of-1-Bits/index.html index 6f06246c2b..fc6939fc41 100644 --- a/2015/03/11/Number-Of-1-Bits/index.html +++ b/2015/03/11/Number-Of-1-Bits/index.html @@ -306,13 +306,13 @@ diff --git a/2020/03/21/docker比一般多一点的初学者介绍三/index.html b/2020/03/21/docker比一般多一点的初学者介绍三/index.html index b524dc8ddd..6a30dee62f 100644 --- a/2020/03/21/docker比一般多一点的初学者介绍三/index.html +++ b/2020/03/21/docker比一般多一点的初学者介绍三/index.html @@ -52,12 +52,12 @@ }; - + - + @@ -66,7 +66,7 @@ - + @@ -259,8 +259,9 @@ Posted on + - + @@ -305,8 +306,7 @@
-
-

运行第一个 Dockerfile

上一篇的 Dockerfile 我们停留在构建阶段,现在来把它跑起来

+

运行第一个 Dockerfile

上一篇的 Dockerfile 我们停留在构建阶段,现在来把它跑起来

1
2
docker run -d -p 80 --name static_web nicksxs/static_web \
nginx -g "daemon off;"

这里的-d表示以分离模型运行docker (detached),然后-p 是表示将容器的 80 端口开放给宿主机,然后容器名就叫 static_web,使用了我们上次构建的 static_web 镜像,后面的是让 nginx 在前台运行

可以看到返回了个容器 id,但是具体情况没出现,也没连上去,那我们想看看怎么访问在 Dockerfile 里写的静态页面,我们来看下docker 进程

发现为我们随机分配了一个宿主机的端口,32768,去服务器的防火墙把这个外网端口开一下,看看是不是符合我们的预期呢

好像不太对额,应该是 ubuntu 安装的 nginx 的默认工作目录不对,我们来进容器看看,再熟悉下命令docker exec -it 4792455ca2ed /bin/bash
记得容器 id 换成自己的,进入容器后得找找 nginx 的配置文件,通常在/etc/nginx,/usr/local/etc等目录下,然后找到我们的目录是在这

所以把刚才的内容复制过去再试试

目标达成,give me five✌️

第二个 Dockerfile

然后就想来动态一点的,毕竟写过 PHP,就来试试 PHP
再建一个目录叫 dynamic_web,里面创建 src 目录,放一个 index.php
内容是

diff --git a/atom.xml b/atom.xml index b42f37ee6e..1c78b73c8f 100644 --- a/atom.xml +++ b/atom.xml @@ -6,7 +6,7 @@ - 2020-03-21T06:43:39.832Z + 2020-03-21T08:19:01.533Z https://nicksxs.me/ @@ -21,7 +21,7 @@ https://nicksxs.me/2020/03/21/docker%E6%AF%94%E4%B8%80%E8%88%AC%E5%A4%9A%E4%B8%80%E7%82%B9%E7%9A%84%E5%88%9D%E5%AD%A6%E8%80%85%E4%BB%8B%E7%BB%8D%E4%B8%89/ 2020-03-21T06:43:39.000Z - 2020-03-21T06:43:39.832Z + 2020-03-21T08:19:01.533Z @@ -29,8 +29,7 @@ - <hr> -<h2 id="运行第一个-Dockerfile"><a href="#运行第一个-Dockerfile" class="headerlink" title="运行第一个 Dockerfile"></a>运行第一个 Dockerfile</h2><p>上一篇的 + <h2 id="运行第一个-Dockerfile"><a href="#运行第一个-Dockerfile" class="headerlink" title="运行第一个 Dockerfile"></a>运行第一个 Dockerfile</h2><p>上一篇的 @@ -314,14 +313,14 @@ - - - - + + + + @@ -353,14 +352,14 @@ - - - - + + + + @@ -392,14 +391,14 @@ - - - - + + + + @@ -432,14 +431,14 @@ - - - - + + + + @@ -471,14 +470,14 @@ - - - - + + + + @@ -510,14 +509,14 @@ - - - - + + + + diff --git a/baidusitemap.xml b/baidusitemap.xml index 8a4e622c21..05172a924c 100644 --- a/baidusitemap.xml +++ b/baidusitemap.xml @@ -34,10 +34,10 @@ https://nicksxs.me/2020/01/19/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E5%9B%9B/ 2020-01-18 - https://nicksxs.me/2015/01/14/Two-Sum/ + https://nicksxs.me/2019/12/10/Redis-Part-1/ 2020-01-12 - https://nicksxs.me/2019/12/10/Redis-Part-1/ + https://nicksxs.me/2015/01/14/Two-Sum/ 2020-01-12 https://nicksxs.me/2016/11/10/php-abstract-class-and-interface/ @@ -49,10 +49,10 @@ https://nicksxs.me/2019/12/26/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D/ 2020-01-12 - https://nicksxs.me/2015/04/14/Add-Two-Number/ + https://nicksxs.me/2015/03/13/Reverse-Integer/ 2020-01-12 - https://nicksxs.me/2015/03/13/Reverse-Integer/ + https://nicksxs.me/2015/04/14/Add-Two-Number/ 2020-01-12 https://nicksxs.me/2014/12/24/MFC%20%E6%A8%A1%E6%80%81%E5%AF%B9%E8%AF%9D%E6%A1%86/ @@ -61,10 +61,10 @@ https://nicksxs.me/2016/08/14/docker-mysql-cluster/ 2020-01-12 - https://nicksxs.me/2019/06/18/openresty/ + https://nicksxs.me/2017/05/09/ambari-summary/ 2020-01-12 - https://nicksxs.me/2017/05/09/ambari-summary/ + https://nicksxs.me/2019/06/18/openresty/ 2020-01-12 https://nicksxs.me/2020/01/04/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E4%BA%8C/ diff --git a/css/main.css b/css/main.css index 97450df684..13385a357e 100644 --- a/css/main.css +++ b/css/main.css @@ -1259,7 +1259,7 @@ pre .javascript .function { } .links-of-author a::before, .links-of-author span.exturl::before { - background: #9d5960; + background: #dbe7fa; border-radius: 50%; content: ' '; display: inline-block; diff --git a/index.html b/index.html index 19633e2424..a7b7ae75d4 100644 --- a/index.html +++ b/index.html @@ -247,8 +247,9 @@ + - +