Docker containers integration into CirrusGrid Cloud is one of the most important and demanded services, offered by a Platform. The synthesis of Docker container portability, together with CirrusGrid flexible management, appeals to developers and allows to effortlessly host and maintain all types of applications available within Docker templates.
The following tutorial deals with the key principles of work with Docker-based applications, which may be a point of interest for both beginners and intermediate developers.
Below we’ll get a particularly detailed insight into the ways of connecting to a Docker container at CirrusGrid, considering both internal and external possibilities, and observe where to find the very basic container information that is required for such connection establishment.
So, let’s see how to:
Each Docker container at CirrusGrid automatically gets a unique internal domain name and internal IP address right after creation. Further, these parameters can be used to access containers in confines of a single Cloud (i.e. to establish connection between them via the platform’s internal network).
1. The very first option you need to consider in case of having necessity to set up interconnection between containers is the embedded functionality of Dockers linking. It allows to connect containers from different layers within a single environment to securely transfer environment variables information from source Docker image to the recipient without exposing any ports externally.
For that, you just need to select the required layer and specify an alias for the connection denomination (whilst all of the appropriate variables will get the corresponding prefix according to it):
Don’t forget to Save and Apply the changes you’ve made.
After that, you may refer to the Variables section of your Docker container settings and adjust any of them separately upon the necessity. Herewith, changing the environment variable’s value for a container, that is already linked to another one, will also cause its automatic update in a container this link was applied to.
2. In case there is a need to establish internal connection of another type (i.e. which requires some manual adjustments via the comprised configuration files), it is required to know the exact container domain name or IP address it can be accessed through the platform’s internal network.
The appropriate information can be obtained in two ways:
Here, the containers’ domain name is shown at the Access URL string and its internal IP address – within the IP line below.
In such a way, the retrieved information can be used to establish internal connection to your Docker containers at CirrusGrid.
In order to access your Docker container from outside a Platform (i.e. from the Internet), CirrusGrid offers the following solutions:
1. If your service or application, that is running within Docker container, listens to the port 80, then it will be automatically exposed to external network (over the assigned domain name) via CirrusGrid Shared Load Balancer.
In such a case, you just need to click Open in browser for the corresponding node to launch it (this option works for HTTP connections).
Note: In case your Docker container does not have an external IP attached, CirrusGrid performs an automatic port redirect. This means that if application listens to a custom port on TCP level, CirrusGrid will try to automatically detect it and forward all the incoming requests to this port number. As a result, in most cases, your dockerized app or service will become available over the Internet under the corresponding node’s domain right after creation.
However, in case you’d like to prohibit such a possibility, you may declare the corresponding rules within your container’s firewall settings.
2. For more complex implementations, CirrusGrid provides special endpoints functionality (available within the same-named section of any environment’s Settings):
It allows to expose the required private port on your container through the randomly chosen public port at CirrusGrid Shared Load Balancer, so it can be accessed via the provided Access URL.
3. And the last option, which gives the maximum freedom (allowing, for example, to secure your connection with Custom SSL, get rid of limitation on the simultaneous connections amount, etc.) is attachment of Public IP address to your Docker container.
By its means, your app can be configured to listen to any port you need and, in such a way, to become accessible via the external network.
Note: Public IP option is a paid add-on. The exact cost for its usage can be seen upon hovering over the price widget at the right part of your topology wizard or through navigating to Quotas & Pricing > Pricing > Options tab.
That’s all! Now you can leverage the most suitable connection option among the described ones while working with your Docker containers.
If you face any issues while setting connection to your Docker container at CirrusGrid, feel free to appeal for our technical experts' assistance at Stackoverflow.
Powered by BetterDocs
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.