Custom Docker 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.

custom Docker images

Tip: Jelastic provides support of the most popular software stacks with ensured template operability and regular updates to the latest version (certified containers).

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.

topology wizard custom Docker

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)

wizard search for image

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.

Docker image specifics

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.

build environment topology

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:

create custom Docker environment

С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.

open container in browser

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.

Note: 
  • 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 80th port 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.

example Docker application

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:

Docker image from custom registry

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.

private registry credentials

Tip: You don’t need to specify a tag during custom image addition, as you’ll be able to choose the required one during the creation/customization of the appropriate container. Furthermore, a list of available image tags is automatically updated upon its selection for installation, so you don’t need to re-add your Docker template to the Custom section just because your application code has been updated.

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.

add image from custom registry

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.

edit repo credentials

5. Within the opened Container Repository Credentials frame, you can specify a new Login and Password for your image.

change container repository credentials

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.

Tip: In case you face any issues while operating with your custom Docker images at the platform, feel free to appeal for our technical experts’ assistance at Stackoverflow.

What’s next?