link deprecated
Hi,
the --link option have been deprecated shouldn't we use the --net option?
bny the way :
The default docker0 bridge network supports the use of port mapping and docker run --link to allow communications between containers in the docker0 network. These techniques are cumbersome to set up and prone to error. While they are still available to you as techniques, it is better to avoid them and define your own bridge networks instead.
from https://docs.docker.com/engine/userguide/networking/
since it is deprecated: should we use the -e PMA_HOST then with the --net argument?
Well --link is used only in examples and documentation and I don't see anything bad in that. Certainly we could add examples using the new approach, patches are welcome.
PS: To me it seems that using networks is way more complex setup, so people will stick with legacy --link for quite some time...
As far as I understand it, there's no need to set up any networks (which is indeed complex), because there is a bridged network by default that has DNS names corresponding to the name label for all containers running in that very network, That's also why link is osbolete (the link parameter is only needed to alias the container names)
Podman does not support the --link option, I think it would be great to update the documentation to be more inclusive with podman users.
Podman does not support the
--linkoption, I think it would be great to update the documentation to be more inclusive with podman users.
I would like to remove this deprecated syntax but as far as I know there is no alternative for it
The Docker documentation for the --link option points to bridge network as an alternative, but I am not sure how to use it in a docker-compose.yml
The Docker documentation for the
--linkoption points to bridge network as an alternative, but I am not sure how to use it in adocker-compose.yml
Bridge networking mode is the default for docker-compose. That basically means you can add container_name to each of your compose services and then you can access other containers within the same compose file by using their container name as the hostname (similar to how you'd do it with the --link option)
i.e.: two services: http and db in your compose file, each has it's container name set to the service name. That means http can access the MySQL on the db service via mysql://user:pass@db:3306/dbname