Defining Template Customization in Dockerfile
The simplest way to prepare your custom stack is to compose a Dockerfile, where the appropriate Jelastic-managed template is set as a base image, and implement customization on its top.
So, go to the Project tab, click the + button and select the New file option from the appeared list.
Within the opened page, specify Dockerfile as a name for this file.
Next, in the editor area, add file content according to the following structure:
FROM jelastic/{image}:{tag}
{your_custom_modifications}
where
- {image} - name of the image from jelastic repository you’d like to use as a base for your stack template
- {tag} - required tag version of the specified template (the full list of available ones can be found by switching to the Tags tab within the appropriate repo details at DockerHub)
- {custom_modifications} - your code to implement necessary customizations; should be specified with Dockerfile syntax (in our example, we’ve defined to automatically create a hello.txt file in the root folder of each corresponding container)
You can customize the default list of favorites folders and files for your stack by defining them in the /etc/jelastic/favourites.conf file:
[directories]
{directories_list}
[files]
{files_list}
For example, provide the following code in your dockerfile to display home directory in favorites list:
RUN mkdir /etc/jelastic/; echo -e "[directories]\n/home" >/etc/jelastic/favourites.con
Optionally, specify a descriptive Commit message and choose Target branch to Commit Changes.
After implementing all the required modifications in Dockerfile, configure CI/CD for customized template to be automatically updated upon new commits.