Hello, prawns! Xiaobai, I wrote a dockerfile, which reads as follows:
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
Then I wrote a index.html locally, and started the mirror image only to find that port was empty. What is the reason for this?
EXPOSE which ports are open and these ports are accessible in services within the same network. But it is not open to the host.
To see the port number in docker ps, specify the -p or -P parameter when docker run is required, such as
-p 80:8080
Map 8080 port in the container to 80 port of the host.