Can I bypass the routing mesh?

0 votes
Is it possible to bypass the routing mesh? If yes, what's the command to do so?
Jul 8 in Docker by Sam
• 1,070 points
11 views

1 answer to this question.

0 votes

Yes. You can bypass the routing mesh, so that when you access the bound port on a given node, you are always accessing the instance of the service running on that node. This is referred to as host mode.

To bypass the routing mesh, you must use the long --publish service and set mode to host. If you omit the mode key or set it to ingress, the routing mesh is used. 

The following command creates a global service using host mode and bypassing the routing mesh.

$ docker service create --name dns-cache \
  --publish published=53,target=53,protocol=udp,mode=host \
  --mode global \
  dns-cache
answered Jul 8 by Sirajul
• 5,960 points

Related Questions In Docker

0 votes
2 answers

How can I inspect the file system of a failed `docker build

Failed command is a build that has ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 6,900 points
53 views
+2 votes
11 answers
0 votes
1 answer

How can I expose more than 1 port with Docker?

To expose just one port, this is ...READ MORE

answered Jul 25, 2018 in Docker by Kalgi
• 37,320 points
24 views
0 votes
1 answer

I lose my data when I get out of the container

No its not installation issue. You need to commit the ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 37,320 points
35 views
0 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
952 views
0 votes
1 answer
0 votes
1 answer

Can I run docker-compose inside a container?

Compose can also be run inside a ...READ MORE

answered Jun 10 in Docker by Sirajul
• 5,960 points
52 views