DEV Community

Arne
Arne

Posted on

1

How to publish UDP ports with Docker-Swarm

I am sure you know those requests, where you think: Hey no problem, i have done this thousand times, give me 5 minutes and it will work.

The same happened last week, when a teammate from zisops asked me to publish a UDP Port for a already running Docker Swarm Service. I have done this 100 times before for "normal" Docker Containers. But hey.. Docker Swarm can't handle this with:

-p 500:500/udp

Ok next step: RTFM but hey.. nothing about publishing a UDP Port for a service. Next try: Start to google.. Gotcha, found a solutions in an Github Issue from the Moby Project. So if you ever have to use UDP with Docker-Swarm remember this small article, and buy me a beer :-)

Solution

docker service create --name my_service \
    --publish mode=host,published=500,target=5004,protocol=udp \
    my_image

Original post in german: https://www.geekpub.de/2017/10/docker-swarm-udp-port-freigeben-fuer-einen-service/

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more