I created my custom image by Torizon Builder and I add also in the docker image of my application.
When I install OS image all works fine, but my application is installed as docker image but not as a running container. I have 2 questions
How can I run automatically the first time without run the command “docker run my image”, (after this command the container starts always)
I need create a folder and default files inside in my root, in order my container app works properly, is this possible using torizon builder? I need to connect the first time and create this by mkdir otherwise my container doesn’t start properly.
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
To address your questions based on the provided context:
Automatically Running a Container: To have your container start automatically after installing your custom Torizon image, you should use a docker-compose.yml file. Place this file in the /var/sota/storage/docker-compose/ directory of your Torizon system. This file should define your container and its configuration. When the system boots, the docker-compose service will automatically start the containers defined in this file. This is the preferred method for starting containers automatically on Torizon OS.
Creating a Folder and Default Files: The context does not provide specific details on using TorizonCore Builder to create folders and files directly on the root filesystem during the image creation process. However, you can potentially achieve this by customizing the Dockerfile of your application container to create necessary directories and files when the container is built or started. Alternatively, you might need to manually create these directories and files on the device after the initial boot if TorizonCore Builder does not support this directly.
Please, also check if these links can help you solve your problem: