Example of using two docker containers communicating through sockets.
In this example one container is reciting Shakespeare's Hamlet to another assuming an average reading speed of 150 words per minute.
Use docker-compose up
inside the docker
folder to start the communication between the two containers.
Optionally you can also run it locally (don't forget to change the config/settings.ini
IP address to localhost
):
Once you have successfully installed Bazel you can run the code in two separate terminals using:
docker run //:run_container -- -t "server"
docker run //:run_container -- -t "client"
The container image is available at:
hub.docker.com/repository/docker/framaxwlad/talking_container