Before you begin
In this tutorial will learn how to connect to different services from the inside of a Docker container. A Linux machine and Docker will be required to follow this tutorial.
Connect to remote services
Make sure you have access to the remote service from the host where containers are running. Example:
In this post you’ll have examples about how to connect and backing up a remote MySQL database using Docker.
Connect to localhost services
Use the following commands to connect from the inside of the container to localhost running services:
Connect to other containerized services
There are two ways to achieve this goal:
1) Link them together using
--link. MySQL client-server example:
2) Use a user-defined
network (Best practice and recommended option). MySQL client-server example: