You can change the settings of Docker containers on a server with a platform using patches. For example, you can add files to a container, change environment variables, and change service settings.
A platform patch is a YAML file in Docker Compose format that contains new container settings. For more information about Docker Compose, see the official documentation.
This article contains instructions for creating and disabling patches.
Creating a patch
The example shows how to change environment variables for the input container. After applying the patch, the value of the NGINX_KEEPALIVE_TIMEOUT variable will be 200, and NGINX_WORKER_CONNECTIONS will be 1000.
To create a patch:
- Connect to the server with the platform via SSH. For more information about connecting via SSH, see Workstation setup.
-
Create the patch file patch.yaml:
patch.yamlversion: "3.5" services: input: environment: NGINX_KEEPALIVE_TIMEOUT: 200 NGINX_WORKER_CONNECTIONS: 1000 -
Apply the patch:
vm add-patch -p=<patch_name> -f=</path/to/patch.yaml>Comments to the command:
- <patch_name> — unique patch name;
- </path/to/patch.yaml> — path to the patch file.
The platform will apply the patch and restart the necessary containers. If the patch is applied successfully, the patch content will be added to the Patches section of the /opt/ispsystem/vm/config.json file in base64 encoding:
{
...
"Patches": {
"patch_name": {
"base64_compose": "dmVyc2lvbjogIjMuNSIKc2VydmljZXM6CiAgaW5wdXQ6CiAgICBlbnZpcm9ubWVudDoKICAgICAgTkdJTlhfS0VFUEFMSVZFX1RJTUVPVVQ6IDIwMAogICAgICBOR0lOWF9XT1JLRVJfQ09OTkVDVElPTlM6IDEwMDA="
}
},
...
}To verify that the environment variables have been changed, examine the output of the commands:
docker exec input env | grep NGINX_KEEPALIVE_TIMEOUTdocker exec input env | grep NGINX_WORKER_CONNECTIONSDisabling a patch
To disable a patch:
- Connect to the server with the platform via SSH. For more information about connecting via SSH, see Workstation setup.
-
Disable a patch:
vm remove-patch -p=<patch_name>Comments to the command:
- <patch_name> — patch name.
Examples of configurable environment variables
Related topics:
En
Es