How to link containers in the portainer?

I have ldap container running in docker

now I want to run the container in portainer phpLdapAdmin

docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-service --detach osixia/phpldapadmin:0.9.0

how can I link ldap-service which is the other container to this in portainer UI ?

The --link flag is not supported in Portainer… and may soon be removed by docker https://docs.docker.com/network/links/

You should consider putting both containers in the same network so that they may reference each other by name via a compose file. I give an example here: https://github.com/portainer/portainer/issues/4137#issuecomment-667765669

1 Like