Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: Are Docker links deprecated?

Tags:

linux

docker

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, but the release notes doesn't mention this and the list of deprecated features doesn't mention it either.

Question

Why does Docker now call links for legacy links? And should I stop use them?

like image 929
Jasmine Lognnes Avatar asked Aug 26 '16 19:08

Jasmine Lognnes


People also ask

Is docker deprecated?

Instead, the Docker runtime is being deprecated in favor of an industry standard in Kubernetes, the open source container orchestration system that's increasingly used for general automation of software deployment, scaling and management.

Can you link containers in docker?

Docker also has a linking system that allows you to link multiple containers together and send connection information from one to another. When containers are linked, information about a source container can be sent to a recipient container.

What does links mean in docker compose?

According to the Docker Compose's compose-file documentation: depends_on - Express dependency between services. links - Link to containers in another service and also express dependency between services in the same way as depends_on.


2 Answers

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.

like image 126
manojlds Avatar answered Sep 19 '22 20:09

manojlds


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/

like image 21
abualy Avatar answered Sep 20 '22 20:09

abualy