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