S
S
semki0962017-03-27 15:57:45
Network administration
semki096, 2017-03-27 15:57:45

How to deal with container ports in docker?

How to deal with container ports in docker? For example, I have 3 users who fill out forms on the test.com page. The form data should be sent to the container I created. And under each user the container is created.
This works with one user and one container. I send the form to the container on test.com:8080/form (I specified port 8080 when creating the container) and everything works. But docker does not create a container for the second user, since this port is occupied by the first container. How can I properly solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lxfr, 2017-04-12
@semki096

In fact, roughly speaking, there are container ports (each of them has 65535 of them) and ports of your host machine (where containers are spinning), there are also 65535 of them. And if 1 port of some container is linked to the port of the host machine, this port of the host machine is already can't be busy. For example, if you have two mysql containers and inside they open 3306 ports, then only one of them can link to port 3306 of the host machine, the second one will say "I'm tired, I'm leaving."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question