how to connect two docker container with host UDP portHow is Docker different from a virtual machine?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?Redirect same port of two Docker containers on different portsConnect a websocket client in a docker container to a websocket server in host
What is the definition of Product
What is "latex-dev"?
How to check status of Wi-Fi adapter through command line?
How can I portray a character with no fear of death, without them sounding utterly bored?
Are there any writings by blinded and/or exiled Byzantine emperors?
How does Harry wear the invisibility cloak?
Would a corpse look different on an interstellar spaceship?
How to fit Schwalbe Marathon Plus 28-622 on 622-16 rim
Initializing a std::array with a constant value
How to run a command 1 out of N times in Bash
Why does this regexpatch command only work once, not twice?
Playing boules... IN SPACE!
What can prevent a super elevator to a space station from being invented?
Can a country avoid prosecution for crimes against humanity by denying it happened?
Calculate Landau's function
What is the significance of 104%
Lumix G7: Raw photos only in 1920x1440, no higher res available
Is the mnemonic in Winter's Tale real?
How Total raw is calculated for Science pack 2?
Why wasn't Linda Hamilton in T3?
One hour 10 min layover in Newark; International -> Domestic connection. Enough time to clear customs?
In mathematics is there a substitution that is "different" from Vieta's substitution to solve the cubic equation?
Is mathematics truth?
Meaning of "educating the ice"
how to connect two docker container with host UDP port
How is Docker different from a virtual machine?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerHow to copy Docker images from one host to another without using a repositoryFrom inside of a Docker container, how do I connect to the localhost of the machine?Redirect same port of two Docker containers on different portsConnect a websocket client in a docker container to a websocket server in host
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am running the two containers. Both containers want to listen the host machine's UDP port. I am getting the data from host over UDP port 1234 and I want to run two containers which will listen the host over UDP port. I think two processes can listen the same UDP port.
I have created two container ffmpeg1 and ffmpeg2.
running first:
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 1234:5000/udp -it ffmpeg2
getting the below error when tried to run second container.
docker: Error response from daemon: driver failed programming external connectivity on endpoint reverent_germain (9915c14466f78f3ae2215d9e53edc502a9b6fff81f08f05f52d79088): Bind for 0.0.0.0:1234 failed: port is already allocated.
ERRO[0000] error waiting for container: context canceled
docker
add a comment |
I am running the two containers. Both containers want to listen the host machine's UDP port. I am getting the data from host over UDP port 1234 and I want to run two containers which will listen the host over UDP port. I think two processes can listen the same UDP port.
I have created two container ffmpeg1 and ffmpeg2.
running first:
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 1234:5000/udp -it ffmpeg2
getting the below error when tried to run second container.
docker: Error response from daemon: driver failed programming external connectivity on endpoint reverent_germain (9915c14466f78f3ae2215d9e53edc502a9b6fff81f08f05f52d79088): Bind for 0.0.0.0:1234 failed: port is already allocated.
ERRO[0000] error waiting for container: context canceled
docker
add a comment |
I am running the two containers. Both containers want to listen the host machine's UDP port. I am getting the data from host over UDP port 1234 and I want to run two containers which will listen the host over UDP port. I think two processes can listen the same UDP port.
I have created two container ffmpeg1 and ffmpeg2.
running first:
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 1234:5000/udp -it ffmpeg2
getting the below error when tried to run second container.
docker: Error response from daemon: driver failed programming external connectivity on endpoint reverent_germain (9915c14466f78f3ae2215d9e53edc502a9b6fff81f08f05f52d79088): Bind for 0.0.0.0:1234 failed: port is already allocated.
ERRO[0000] error waiting for container: context canceled
docker
I am running the two containers. Both containers want to listen the host machine's UDP port. I am getting the data from host over UDP port 1234 and I want to run two containers which will listen the host over UDP port. I think two processes can listen the same UDP port.
I have created two container ffmpeg1 and ffmpeg2.
running first:
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 1234:5000/udp -it ffmpeg2
getting the below error when tried to run second container.
docker: Error response from daemon: driver failed programming external connectivity on endpoint reverent_germain (9915c14466f78f3ae2215d9e53edc502a9b6fff81f08f05f52d79088): Bind for 0.0.0.0:1234 failed: port is already allocated.
ERRO[0000] error waiting for container: context canceled
docker
docker
edited Mar 28 at 6:18
Berkhan Berkdemir
3063 silver badges14 bronze badges
3063 silver badges14 bronze badges
asked Mar 28 at 1:51
Amandeepsinghsaini .gmail.comAmandeepsinghsaini .gmail.com
277 bronze badges
277 bronze badges
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
You have to switch the ports because first port defines your local interface and the second one defines your container port.
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 5000:1234/udp -it ffmpeg2
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
add a comment |
You can not listen the same UDP port on one host.
So in second container, let use another port, eg: 1235
docker run --rm -p 1235:5000/udp -it ffmpeg2
Or in one host. You can call directly from container by creating network
1) Create new network:
$ docker network create ffmpeg
2) Connect containers to network
$ docker run --rm --name=ffmpeg --net=ffmpeg -it ffmpeg
$ docker run --rm --name=ffmpeg2 --net=ffmpeg -it ffmpeg
3) Now you can call directly from container by container name ffmpeg, ffmpeg2
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
add a comment |
You can bind to different IPs on host machine, if multiple network cards are available on your host machine.
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
add a comment |
1) if the data is broadcasting UDP, binds to different ip:same_port, you can sign different ip to the same network card.
2) use a port duplicating method on host, i.e., port 1234 -> 1235
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389034%2fhow-to-connect-two-docker-container-with-host-udp-port%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to switch the ports because first port defines your local interface and the second one defines your container port.
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 5000:1234/udp -it ffmpeg2
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
add a comment |
You have to switch the ports because first port defines your local interface and the second one defines your container port.
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 5000:1234/udp -it ffmpeg2
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
add a comment |
You have to switch the ports because first port defines your local interface and the second one defines your container port.
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 5000:1234/udp -it ffmpeg2
You have to switch the ports because first port defines your local interface and the second one defines your container port.
docker run --rm -p 1234:1234/udp -it ffmpeg
docker run --rm -p 5000:1234/udp -it ffmpeg2
answered Mar 28 at 1:58
Berkhan BerkdemirBerkhan Berkdemir
3063 silver badges14 bronze badges
3063 silver badges14 bronze badges
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
add a comment |
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
I am receiving the data at port 1234 in host machine. if i tried to listen to 5000 the I will not receive ant data.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
You cannot listen the same port in the same network; however, you can use load balancer.
– Berkhan Berkdemir
Mar 28 at 23:04
add a comment |
You can not listen the same UDP port on one host.
So in second container, let use another port, eg: 1235
docker run --rm -p 1235:5000/udp -it ffmpeg2
Or in one host. You can call directly from container by creating network
1) Create new network:
$ docker network create ffmpeg
2) Connect containers to network
$ docker run --rm --name=ffmpeg --net=ffmpeg -it ffmpeg
$ docker run --rm --name=ffmpeg2 --net=ffmpeg -it ffmpeg
3) Now you can call directly from container by container name ffmpeg, ffmpeg2
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
add a comment |
You can not listen the same UDP port on one host.
So in second container, let use another port, eg: 1235
docker run --rm -p 1235:5000/udp -it ffmpeg2
Or in one host. You can call directly from container by creating network
1) Create new network:
$ docker network create ffmpeg
2) Connect containers to network
$ docker run --rm --name=ffmpeg --net=ffmpeg -it ffmpeg
$ docker run --rm --name=ffmpeg2 --net=ffmpeg -it ffmpeg
3) Now you can call directly from container by container name ffmpeg, ffmpeg2
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
add a comment |
You can not listen the same UDP port on one host.
So in second container, let use another port, eg: 1235
docker run --rm -p 1235:5000/udp -it ffmpeg2
Or in one host. You can call directly from container by creating network
1) Create new network:
$ docker network create ffmpeg
2) Connect containers to network
$ docker run --rm --name=ffmpeg --net=ffmpeg -it ffmpeg
$ docker run --rm --name=ffmpeg2 --net=ffmpeg -it ffmpeg
3) Now you can call directly from container by container name ffmpeg, ffmpeg2
You can not listen the same UDP port on one host.
So in second container, let use another port, eg: 1235
docker run --rm -p 1235:5000/udp -it ffmpeg2
Or in one host. You can call directly from container by creating network
1) Create new network:
$ docker network create ffmpeg
2) Connect containers to network
$ docker run --rm --name=ffmpeg --net=ffmpeg -it ffmpeg
$ docker run --rm --name=ffmpeg2 --net=ffmpeg -it ffmpeg
3) Now you can call directly from container by container name ffmpeg, ffmpeg2
edited Mar 28 at 2:06
answered Mar 28 at 1:58
nhancaonhancao
1211 silver badge3 bronze badges
1211 silver badge3 bronze badges
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
add a comment |
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
FFMpeg uses UDP 1234 as a default port, so I think that the guy was trying to use different port, but also, doesn't want to change the default UDP port value
– Berkhan Berkdemir
Mar 28 at 2:00
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if I used the different host port as you said 1235 then how i will get the data which is present at host port 1234.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:38
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
if you choose port 1235 you can use this port to get the data
– nhancao
Mar 29 at 1:34
add a comment |
You can bind to different IPs on host machine, if multiple network cards are available on your host machine.
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
add a comment |
You can bind to different IPs on host machine, if multiple network cards are available on your host machine.
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
add a comment |
You can bind to different IPs on host machine, if multiple network cards are available on your host machine.
You can bind to different IPs on host machine, if multiple network cards are available on your host machine.
answered Mar 28 at 8:02
Akash SharmaAkash Sharma
4542 silver badges6 bronze badges
4542 silver badges6 bronze badges
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
add a comment |
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
i have only one network card.
– Amandeepsinghsaini .gmail.com
Mar 28 at 17:12
add a comment |
1) if the data is broadcasting UDP, binds to different ip:same_port, you can sign different ip to the same network card.
2) use a port duplicating method on host, i.e., port 1234 -> 1235
add a comment |
1) if the data is broadcasting UDP, binds to different ip:same_port, you can sign different ip to the same network card.
2) use a port duplicating method on host, i.e., port 1234 -> 1235
add a comment |
1) if the data is broadcasting UDP, binds to different ip:same_port, you can sign different ip to the same network card.
2) use a port duplicating method on host, i.e., port 1234 -> 1235
1) if the data is broadcasting UDP, binds to different ip:same_port, you can sign different ip to the same network card.
2) use a port duplicating method on host, i.e., port 1234 -> 1235
answered Jul 3 at 10:24
bianbianbianbian
3662 silver badges2 bronze badges
3662 silver badges2 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389034%2fhow-to-connect-two-docker-container-with-host-udp-port%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown