docker不显示端口映射呢?
世界只因有你
世界只因有你 2017-04-26 09:01:22
0
2
1113

各位大虾好!小白我写了一个dockerfile,内容如下:

FROM ubuntu:14.04
MAINTAINER Chris Chan "chenx1242@163.com"
ENV REFRESHED_AT 2016-12-05
RUN apt-get -y update && apt-get install -y nginx
RUN mkdir -p /var/www/html/website
ADD nginx/global.conf /etc/nginx/conf.d/
ADD nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

然后又在本地写了一个index.html,然后启动这个镜像却发现port那里为空,请问大神们这样情况是什么原因呢?

世界只因有你
世界只因有你

reply all(2)
習慣沉默

EXPOSE refers to which ports are open and accessible to services within the same network. But it is not open to the host machine.

To see the port number in docker ps, you need to specify the -p or -P parameter when docker run, such as -p 80:8080 Map port 8080 in the container to port 80 of the host.

我想大声告诉你

The PORTS of docker ps displays the docker run -pspecified port mapping

EXPOSE means a port open to other containers (not external networks), and this is not displayed in docker ps.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!