diff --git a/compose/compose-file/compose-file-v1.md b/compose/compose-file/compose-file-v1.md index c0a65dc5122..2ea14cd5f81 100644 --- a/compose/compose-file/compose-file-v1.md +++ b/compose/compose-file/compose-file-v1.md @@ -355,6 +355,9 @@ It's recommended that you use reverse-DNS notation to prevent your labels from c Link to containers in another service. Either specify both the service name and a link alias (`SERVICE:ALIAS`), or just the service name. +> Links are a legacy option. We recommend using +> [networks](#networks) instead. + web: links: - db diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md index a21b40a5d7e..0c7f1de012c 100644 --- a/compose/compose-file/compose-file-v2.md +++ b/compose/compose-file/compose-file-v2.md @@ -702,6 +702,9 @@ It's recommended that you use reverse-DNS notation to prevent your labels from c Link to containers in another service. Either specify both the service name and a link alias (`"SERVICE:ALIAS"`), or just the service name. +> Links are a legacy option. We recommend using +> [networks](#networks) instead. + web: links: - "db" diff --git a/compose/compose-file/index.md b/compose/compose-file/index.md index 90a51209656..e8e144b9d33 100644 --- a/compose/compose-file/index.md +++ b/compose/compose-file/index.md @@ -1007,7 +1007,7 @@ specifying both the container name and the link alias (`CONTAINER:ALIAS`). > > If you're using the [version 2 or above file format](compose-versioning.md#version-2), the externally-created containers must be connected to at least one of the same networks as the service which is -linking to them. Starting with Version 2, [links](compose-file-v2#links) are a +linking to them. [Links](compose-file-v2#links) are a legacy option. We recommend using [networks](#networks) instead. > > This option is ignored when [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md)