making images communicate with each other Docker -
i have created webapp in docker. webapp uses other docker images such redis, mariadb. these , running locally. have created image of webapp. have 3 images : webapp(which not up), redis , mariadb up.
when tried run image of webapp fails start .. unable connect other images (redis , mariadb).
how can make webapp image communicate other required images
you need create docker network attach containers together.
docker network create net
then can either start containers network option:
docker run --network net ...
or if containers running, can connect them network
docker network connect net <container-name>
once that, containers can communicate each other using container name hostname, example: redis, mongo ...
Comments
Post a Comment