How to get the new Docker CLI interpreter to connect to databases in other containers

Hi Guys,

Because the new Docker CLI interpreter uses an image rather than a container built by docker-compose I'm wondering how to get it to connect to databases contained in other docker containers...

Normally I get docker-compose to link all the containers together using:

links:
- database.internal

And then use 'database.internal' as the hostname in the php config - however this won't work when docker-compose isn't being used...

I'm aware that you can pass docker run parameters that do the same thing - can you give me some pointers as to how to set this up..

Alternatively can it be configured in the Dockerfile before the build is done, any Pointers?

Thanks

Wayne

0
3 comments
Avatar
Permanently deleted user

Ok I've worked it out... Once you've followed the standard help instructions for using docker as a remote CLI found here

File > Settings > PHP > Docker Container [...] button - Links contain the named links and Network mode is the name of the network discovered using

```docker network ls```



0
Avatar
Permanently deleted user

File > Settings > PHP > Docker Container [...] button

Woud you be so kind as to show a screenshot of the button? I see nothing

0
Avatar
Permanently deleted user

You can add `--network` into command line options. Check https://www.jetbrains.com/help/idea/docker.html#docker_deployment_run_configs .

0

Please sign in to leave a comment.