Defining Template Customization in Dockerfile
The simplest way to prepare your custom stack is to compose a Dockerfile, where the appropriate platform-managed template is set as a base image, and implement customization on its top.
1. So, go to the Project tab, click the + button and select the New file option from the appeared list.
2. 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:
|
|
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)
Tip: You can customize the default list of favorites folders and files for your stack by defining them in the /etc/jelastic/favourites.conf file:
|
|
For example, provide the following code in your dockerfile to display home directory in favorites list:
|
|
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.