Communication between linked docker containers

只愿长相守 提交于 2019-12-06 07:26:53
VonC

As mentioned in Docker links:

Docker also defines a set of environment variables for each port exposed by the source container.
Each variable has a unique prefix in the form:

<name>_PORT_<port>_<protocol>

The components in this prefix are:

  • the alias specified in the --link parameter (for example, webdb)
  • the <port> number exposed
  • a <protocol> which is either TCP or UDP

That means you need to make sure that Container1 exposes the right port with the right protocol (in your case, UDP): see "How do I expose a UDP Port on Docker?"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!