今天,我们来聊聊 web Server 如何创立并观看页面。
首先,pull nginx 的 Image 下来
观看 Image 能否被 pull 下来了
建立 Container
-p : 设定外部连接容器内部的 port 号
观看 Container 内容
这时候能看到有个 ports 8080 是外部的 port 会打 Container 内部的 80 port,所以只需打下列网址即可以看到 nginx 的预设页面了
http://localhost:8080
由于我是使用虚拟机下去实作的所以会打 IP ,本机直接 localhost 就可。