Docker: Are Docker links deprecated?

后端 未结 2 1096
小蘑菇
小蘑菇 2020-12-03 13:47

When reading about linking containers together they now call it legacy links e.g. here.

This article claims links got deprecated in Docker 1.9,

相关标签:
2条回答
  • 2020-12-03 14:05

    well at least mentioned here by Docker official documentation:

    Warning: The --link flag is a deprecated legacy feature of Docker. It may eventually be removed. Unless you absolutely need to continue using it, we recommend that you use user-defined networks to facilitate communication between two containers instead of using --link. One feature that user-defined networks do not support that you can do with --link is sharing environmental variables between containers. However, you can use other mechanisms such as volumes to share environment variables between containers in a more controlled way.

    https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/

    0 讨论(0)
  • 2020-12-03 14:08

    Docker networking is being promoted as successor - https://docs.docker.com/engine/userguide/networking/

    Before the Docker network feature, you could use the Docker link feature to allow containers to discover each other. With the introduction of Docker networks, containers can be discovered by its name automatically.

    On whether you should stop using them - yes. The docker world is currently moving very fast, and links has been "legacy" for a few releases now.

    0 讨论(0)
提交回复
热议问题