Docker Compose Files
Docker Tools
Docker and Docker Compose are used to manage the Edge Xpert Services.
Using Docker
For information on installing Docker, refer to Installation.
The Edge Xpert microservices are deployed in Docker containers.
For information on the Docker commands, refer to the Docker CLI documentation
Using Docker Compose
For information on installing Docker Compose, refer to Installation.
Edge Xpert uses Docker Compose to obtain and configure the latest images and to install, start the stop the microservice containers.
The docker-compose YAML files drive the edgexpert CLI tool. For further information on the Docker Compose YAML file see Configuration Files and Using a Local Docker Compose File.
For information on the Docker Compose commands, refer to the Docker Compose CLI documentation.
Configuration Files
Edge Xpert installs the Docker Compose and Application Service YAML files to /etc/edgexpert/. These files contain the configuration settings used by Edge Xpert.
The following Docker Compose YAML files are provided:
File | Description |
---|---|
docker-compose.yml | Default configuration file |
docker-compose-security.yml | Used when security mode is enabled, overrides the base docker-compose.yml with security settings. |
app-service.yml | Default configuration file used by the Application Services |
app-service-security.yml | Used when security mode is enabled, overrides the base app-service.yml with security settings. |
To view the content, open the file in a text editor.
IOTech recommends that you use Docker Compose Override if you need to make any changes.
For further information on the Docker Compose file, refer to the Compose file reference. For further information on using a local Docker Compose file within Edge Xpert, see Using a Local Docker Compose File.
Using a Local Docker Compose File
For more information on the docker-compose file content and parameters see Configuration File Content.
If you want to make changes to the configuration, it is best practice to override it with local YAML files.
Override the Docker Compose Files
To override the Docker Compose file, complete the following steps:
- Create the YAML files identical to /etc/edgexpert in your chosen local directory. For example, ~/local-compose/docker-compose.yml
- Open the local YAML file in an editor
-
Override the existing settings, or add your own configuration settings, as required.
Below, an example of overriding with local docker-compose.yml can be found. This example demonstrates overriding the log level configuration with the environment variable
WRITABLE_LOGLEVEL
:services: device-virtual: environment: WRITABLE_LOGLEVEL: DEBUG
Note
The above configuration changes the log level to
DEBUG
. This can generate a large number of log lines and is only advised when attempting to debug. The default isINFO
. -
Save the local docker-compose.yml file
Run Edge Xpert with Local Docker Compose File
If using a local Docker Compose files, you must run the edgexpert CLI commands from the directory containing your YAML files.
The following message at the start of the output from a command indicates that a local Docker Compose file is being used:
$ edgexpert up
Overriding configuration with local docker-compose.yml
Note
Before Edge Xpert v2.1.2 Docker Compose Override was not yet introduced and YAML files must be copied and edited as a whole.
Docker Compose Override
Edge Xpert leverages docker-compose override mechanism starting from v2.1.2 release. This simplifies the effort for user to modify the configuration file.
If configuration files exist in EDGEXPERT_COMPOSE_PATH
or local directory, Edge Xpert will try to override base configuration
with those files. The priority would be:
1. local(current) directory
2. EDGEXPERT_COMPOSE_PATH
3. default directory (/etc/edgexpert)
This rule applies on docker-compose.yml, docker-compose-security.yml and docker-compose.<EDGEXPERT_PROJECT>.yml.
For example:
$ export EDGEXPERT_COMPOSE_PATH=scripts/composefiles
$ export EDGEXPERT_PROJECT=prod
$ edgexpert up --secret
Overriding configuration with /home/user/scripts/composefiles/docker-compose.yml
Overriding configuration with local docker-compose.prod.yml
Creating network "edgexpert_edgex-network" with driver "bridge"
...
Note
For the usage of EDGEXPERT_COMPOSE_PATH
and EDGEXPERT_PROJECT
please refer to Environment Variables