L
L
Luan2020-09-15 02:11:03
Nginx
Luan, 2020-09-15 02:11:03

Why is nginx not starting in a Docker container?

I make a standard dockerfile:
FROM nginx:latest
COPY ./index.html /usr/share/nginx/html/index.html
EXPOSE 80

But it doesn't want to open on the web. Apparently I'm missing a command or an item? Did according to the guide. There you build the container and then run it with the command docker run -it --rm -d --name web nginx001. But it still doesn't want to start.
I just know Docker and I want to understand what I missed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Vasilyev, 2020-09-15
@vasilyevmn

expose does not open a port.
You need to start by adding the key to docker run:
-p 80:80

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question