Modifying docker-compose.yml file to load a custom image

I am unable to get my docker image to load at start up of torizon core build, by adding it to /var/sota/storage/docker-compose/docker-compose.yml file. I am able to do a docker run of the image at the ssh command line though when trying to get it to auto load a boot up it does not load.

Also, if there are other standard images (e.g. torizon/weston-vivante, portainer/portainer-ce) they also do not load, I expect indicating that my added qse image is interfering with the docker-compose image running process. (note: sha256 value shorted with … added in middle just for this example)

Any help/insight would be appreciated on this approach or other approaches. - Thanks!

The torizon core is a custom build based on “torizon-core-docker-colibri-imx8x-Tezi_5.4.0+build.10.tar”

my docker-compose.yml file looks like this:

services:
qse:
image: roboware/qse-torizon@sha256:da33b5c9 … 53b968d
ports:
- “3333:3333/tcp”
- “8888:8888/tcp”
devices:
- “/dev/colibri-uartb:/dev/colibri-uartb”
- “/dev/gpiochip0:/dev/gpiochip0”
- “/dev/gpiochip1:/dev/gpiochip1”
- “/dev/gpiochip2:/dev/gpiochip2”
- “/dev/gpiochip3:/dev/gpiochip3”
- “/dev/gpiochip4:/dev/gpiochip4”
- “/dev/gpiochip5:/dev/gpiochip5”
volumes:
- source: /tmp
target: /tmp
type: bind
- source: /dev
target: /dev
type: bind
- source: /var/run/dbus
target: /var/run/dbus
type: bind
version: ‘2.4’

Greetings @RayO,

So what happens exactly when you try to auto load this container on boot? Is there an error, or just nothing happens?

We use a systemd service that auto-runs any docker-compose.yml file located at /var/sota/storage/docker-compose at boot time.

Could you run systemctl status docker-compose and also journalctl -f -u docker-compose. These commands should return the logs for this systemd service. This will hopefully tell us what’s going on, or whether the service is even running properly.

Best Regards,
Jeremias

Thanks Jeremias,

Looks like the docker-compose.service is running ok (output at end of message).

I have started just running a docker-compose.yml file in the home torizon directory to isolate the problem in the running of the container as a docker-compose.yml file, using “docker-compose up”. when I do this the container runs exits(0) or resets periodically if reset is selected in docker-compose file options.

Something between the docker run command line (works) and translation to docker-compose.yml (doesn’t work) seems to be the issue at this point. Using the docker-compose up and local docker-compose.yml file the image does not persists or just resets after run. I will continue to try to find the working docker-compose.yml commands, once again any input would be appreciated, thanks!

*** Command line working ***

docker run --rm -it -p 8888:8888 -p 3333:3333 --device /dev/colibri-uartb --device /dev/gpiochip0 --device /dev/gpiochip1 --device /dev/gpiochip2 --device /dev/gpiochip3 --device /dev/gpiochip4 --device /dev/gpiochip5 -v /var/run/dbus:/var/run/dbus -v /dev:/dev 634c354e3a18

*** docker-compose.yml (not working) ***

service:
qse:
image: 634c354e3a18
ports:
- “3333:3333/tcp”
- “8888:8888/tcp”
devices:
- “/dev/colibri-uartb:/dev/colibri-uartb”
- “/dev/gpiochip0:/dev/gpiochip0”
- “/dev/gpiochip1:/dev/gpiochip1”
- “/dev/gpiochip2:/dev/gpiochip2”
- “/dev/gpiochip3:/dev/gpiochip3”
- “/dev/gpiochip4:/dev/gpiochip4”
- “/dev/gpiochip5:/dev/gpiochip5”
volumes:
- source: /tmp
target: /tmp
type: bind
- source: /dev
target: /dev
type: bind
- source: /var/run/dbus
target: /var/run/dbus
type: bind
version: ‘2.4’

*** docker-compose.service check ***

colibri-imx8x-06900091:~$ systemctl status docker-compose
● docker-compose.service - Docker Compose service with docker compose
Loaded: loaded (/usr/lib/systemd/system/docker-compose.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2021-12-22 15:17:56 EST; 3min 59s ago
Process: 851 ExecStart=/usr/bin/docker-compose -p torizon up -d --remove-orphans (code=exited, status=0/SUCCESS)
Process: 852 ExecStartPost=/usr/bin/rm -f /tmp/recovery-attempt.txt (code=exited, status=0/SUCCESS)
Main PID: 851 (code=exited, status=0/SUCCESS)

Dec 22 15:17:56 colibri-imx8x-06900091 systemd[1]: Starting Docker Compose service with docker compose…
Dec 22 15:17:56 colibri-imx8x-06900091 systemd[1]: Started Docker Compose service with docker compose.
Dec 22 15:18:00 colibri-imx8x-06900091 docker-compose[851]: Creating network “torizon_default” with the default driver
Dec 22 15:18:00 colibri-imx8x-06900091 docker-compose[851]: Creating torizon_qse_1 …
Dec 22 15:18:03 colibri-imx8x-06900091 docker-compose[851]: [45B blob data]
colibri-imx8x-06900091:~$ journalctl -f -u docker-compose
– Logs begin at Wed 2021-12-22 15:17:45 EST. –
Dec 22 15:17:56 colibri-imx8x-06900091 systemd[1]: Starting Docker Compose service with docker compose…
Dec 22 15:17:56 colibri-imx8x-06900091 systemd[1]: Started Docker Compose service with docker compose.
Dec 22 15:18:00 colibri-imx8x-06900091 docker-compose[851]: Creating network “torizon_default” with the default driver
Dec 22 15:18:00 colibri-imx8x-06900091 docker-compose[851]: Creating torizon_qse_1 …
Dec 22 15:18:03 colibri-imx8x-06900091 docker-compose[851]: [45B blob data]

An update … I have my qse app running now with the docker-compose service. Finding the tricks to make it run using a local file and docker-compose up to run it was the diagnostic tool that helped me narrow down the issue I was having. Thanks for your help Jeremias, happy holidays : )

Glad to hear you were able to get it resolved!