As I understand “link” flag deprecated in “docker run”, but docker-compose will continue use “link” but using “docker network connect”.
Usage: docker network connect [OPTIONS] NETWORK CONTAINER
Connect a container to a network
Options:
--alias stringSlice Add network-scoped alias for the container
--help Print usage
--ip string IP Address
--ip6 string IPv6 Address
--link list Add link to another container (default [])
--link-local-ip stringSlice Add a link-local address for the container