Docker, the main engine behind the management of Containers within TorizonCore, is already configured to start at boot.
And together with it, there is a service called docker-compose, which will initialize the containers described by a docker-compose.yml file present in /var/sota/storage/docker-compose/
directory of your TorizonCore system.
You can, of course, create your own Systemd service and start your container through the execution of its "docker run...", but using the docker-compose.yml as mentioned above is the preferred way of starting a Container with TorizonCore.
Note: Please have an overview of the Docker-compose for more details.
With Toradex Easy Installer, you can install TorizonCore with Evaluation Containers.
It brings together several containers focused on development, like Weston and Portainer, already set to start at boot together with Docker.
Please feel free to install TorizonCore with Evaluation Containers and study their configuration and parameters.
Leaving your docker-compose.yaml file at /var/sota/storage/docker-compose/
directory will make your containers automatically start together with the system. And there are also some adjustments you can make in order to control the behavior of your containers.
That can be done with the restart flag, which can be set through the command line, by docker run or docker update, or by setting the parameter restart at docker-compose.yml for the given container image.
For both command line and docker-compose.yml, the restart parameter flag can assume one of the following values:
As mentioned previously, the preferred way of starting containers with TorizonCore is through a docker-compose.yml at /var/sota/storage/docker-compose/
.
The restart flag parameter is a complement to make it possible to automatically restart given container images, which is done by Docker itself.
Once you have your docker-compose.yml structured and validated, you can pre-provision a customized TorizonCore image with that, so you can use it for flashing several units, which is very useful for production.
You can find more details about this process in our article Pre-provisioning Docker Containers onto a TorizonCore Image. With the resulting image at the end of this process, the containers defined in your docker-compose.yml will be set to be started automatically.
The process of pre-provisioning a TorizonCore image with custom containers makes use of our TorizonCore Builder Tool.