James Lin
James Lin

Reputation: 26528

Can docker containers within same host have same ports

I am a noob to docker and I was reading the docs:

Networks, by definition, provide complete isolation for containers.

Does that mean I can have nginx service on port 80 in each container in the same host, and start each image to use port 80 within it's own container and map the ports:

eg.

8080:80 <--- container 1
8081:80 <--- container 2

Upvotes: 2

Views: 92

Answers (1)

ldg
ldg

Reputation: 9402

Yes. Did you try this? It should work just fine.

Upvotes: 4

Related Questions