Technical questionAccepted answer
When I specify ports in a docker-compose.yml file, is it TCP or UDP?
Mathias Lykkegaard Lorenzen
Feb 4
0 views1
I know that I can specify the protocol of "ports" in the docker-compose.yml file, but I am unsure what the default protocol is, if no protocol is specified.
Is it TCP? Is it UDP? Both?
I haven't been able to find the answer anywhere (including in the Docker Compose file reference).
1 answer
Accepted answer · original discussion
CocoBagarre
PermalinkFeb 4
by default TCP is used, you can see it launching docker-compose ps
If you want to specify you should add /udp or /tcp like :
ports:
- "80:80/udp"
- "80:80/tcp"
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
Mathias Lykkegaard LorenzenPermalink
Feb 4
And if I want both? Do I specify the same port twice with different protocols?