Prasong Pansri
Prasong Pansri

Reputation: 1

Docker UDP port support?

I have been testing as in the environment below:

my current lab

everything worked well, except i can not contact UDP Port in docker container, please advice me.

also currently i use "ip netns exec" to set IP address any easy way to fix IP address in container?

thank for advance Prasong P.

Upvotes: 0

Views: 3733

Answers (3)

Bryan
Bryan

Reputation: 12190

There is a docker exec command to do the ip netns exec for you.

Upvotes: 0

user2915097
user2915097

Reputation: 32156

It is in the docs, here is an extract from

https://docs.docker.com/userguide/dockerlinks/

You can also bind UDP ports by adding a trailing /udp. For example:

$ sudo docker run -d -p 127.0.0.1:5000:5000/udp training/webapp python app.py

Upvotes: 2

neciu
neciu

Reputation: 4485

You can expose UDP ports adding /udp suffix. Example:

docker run -p 127.0.0.1:53:5353/udp <image> <cmd>

Upvotes: 7

Related Questions