Custom Containers Deployment
Jelastic PaaS allows creating any software solution packaged as a Docker container and stored at Docker Hub or any other registry (including private ones). Herewith, you’ll get all the benefits of the platform (e.g. automatic vertical and horizontal scaling, logs, statistics and alerts monitoring, embedded configuration file manager, etc.). However, the operability of the application inside of such a custom container cannot be guaranteed.
Within this guide, you’ll find out how to get started with custom Docker containers - how to create and manage all types of applications and services that are available within the Docker Hub or your custom private registry.
Custom Containers from Docker Hub
1. Open the environment topology wizard by clicking the New Environment button at the top-left corner of the dashboard.
Switch to the Docker tab at the top of the wizard. Inside, you’ll find several blocks with different layer names to the left, where each of them provides an ability to create a custom container based on the selected Docker image. Use these sections to divide and structurize the topology according to your needs.
Switch to the required layer and proceed with the Select Image button.
2. In the opened Select Container frame, you’ll see a few tabs:
- Quick Start, which provides a set of the most popular/recommended templates for the current layer (this tab may be absent depending on your hosting service provider settings)
- Search, which allows you to find the desired template at the central Docker Hub registry
- Custom, where you can add your own template from the custom/private registries
- Favorite, where you can store the images for quick access (i.e. which you presume to use in future)
As an example, let’s Search the official Docker Hub registry - navigate to the same-named tab, type the full or part of the required name to the input field (e.g. dockersample/static-site) and hit Enter. After being shown the list of results, click on the preferred template to add it to the chosen layer (it will be marked with a tick and become highlighted). The necessary tag can be selected with the drop-down list at the top of the frame.
Tip: Hovering over a particular image will expand the plank with a few auxiliary functions. Click on the More details string to open the corresponding repository page at Docker Hub in a separate browser tab.
The star icon at the top-right corner can be used for marking an image as Favorite, so it will be stored within the same-named tab for quick access (in the same way, it can be unticked for being removed from the list).
Only a single Docker image (or multiple instances of the same template) can be selected per layer. Herewith, you can add other images to different layers, use Extra blocks to add as many as you need.
Click the Next button after you’ve finished composing the topology.
3. Once you are back at the wizard with all the required custom containers added, you can start configuring and managing them just as any regular node:
Сlick on the Create button at the bottom of the wizard to initiate the environment creation.
4. That’s all! In a few minutes, your environment with custom containers will be created and will appear on the dashboard.
You can Open in Browser each container with the corresponding button next to it or the whole environment via the assigned domain (shown below the environment name). In the latter case, the application server or balancer layer’s template will be opened.
- Not all custom containers have the web interface running out of the box. Thus you can get the 502 application down error while trying to access such a node via the browser. However, that doesn’t mean this image is incorrect or corrupted. If you’d like to ensure the necessary service is working, check the running processes inside a container using the SSH connection.
- In case an application is deployed to a container without the public IP and is not listening to the port 80 on its backend, you’ll be shown the dedicated 502 - Service is down error page while trying to open it. In such a case, you need to ensure your container has an HTTP service running and set for handling the incoming requests through the port mentioned above.
In our case, if opening the environment, a sample Docker application will be launched.
If you’d like to make any additional configurations to a container, you can either perform them right through your dashboard via an embedded file manager or in the terminal after accessing it via SSH (including Web SSH option). In both cases, you are granted the full root permissions for accomplishing the desired adjustments.
Containers from Custom/Private Registry
In addition to the numerous public templates available to be found within the official Docker Hub registry, Jelastic gives you an ability to add and deploy your own private image from any custom registry. This template will be remembered by platform (stored within the dedicated Custom section), allowing you to work with it in the same way as with any public image. Herewith, in case your repository is protected, you’ll need to specify the appropriate access credentials (just once during the addition). At the same time, all the subsequent authentication required for container scaling or redeployment will be performed automatically.
Such an image addition can be done via the Docker section in the topology wizard.
1. Start with switching to the Custom tab and clicking the Add New Image button:
2. In the opened frame, insert the Name of your repository into the corresponding field. Herewith, images from Docker Hub can be specified without setting the registry host at the beginning of an image name.
In case your repository is private, you’ll need to additionally specify the proper credentials via the Username and Password fields (otherwise, leave them empty). Click Add to proceed.
3. In a few seconds, your new template will be added to the list of your custom images so that it can be easily deployed at the Jelastic platform.
In case a particular custom template is not needed anymore, it can be removed from the list by clicking on the bin icon at the top-right corner of the appropriate plank. Similarly, an image can be included in the list of Favorites using the star icon nearby.
4. In case you need to update access credentials to any of your custom containers, hover over the appropriate layer in the dashboard, expand the Additionally list, and click the Repo Credentials option.
5. Within the opened Container Repository Credentials frame, you can specify a new Login and Password for your image.
Apply changes with the same-named button.
That’s all. Now, you are acquainted with the custom containers addition from non-default repositories to Jelastic PaaS.