Answer the question
In order to leave comments, you need to log in
Is it possible to open a port in a Dockerfile?
Good afternoon, ladies and gentlemen. There is one Dockerfile
FROM nginx:latest
VOLUME /home/user/folder/:/usr/share/nginx/html/
EXPOSE 80:80
Answer the question
In order to leave comments, you need to log in
From the documentation:
That is, there is nothing in the dockerfile about where ports are forwarded from the container and where volumes are mounted from. All this is specified when creating the container, since the infrastructure outside the container should not depend on the dockerfile.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question