P
P
Proshka172020-04-16 00:38:51
linux
Proshka17, 2020-04-16 00:38:51

Port forwarding in Docker?

Good afternoon!
I just started working with Docker and I have the following question:
Can I run a container like this:
docker run -d -p 3301:80 img1
As far as I understand, this is how I forward port 3301 to port 80 in the container. Does this mean that everything sent to port 80 inside the container will end up on port 3301 outside the container? That is, the ports are prokinut in both directions?

If not, then how can you port the port from the container to the outside?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2020-04-16
@Proshka17

No. You will leave as usual. This is the forwarding of incoming traffic from the main interface to the Docker network.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question