mcuadros/ofelia

Container label option appears to be getting ignored

Opened this issue · 0 comments

If I setup and exec job on another container via labels it fails as it's unable to find my bash script.
Error: StdOut: OCI runtime exec failed: exec failed: unable to start container process: exec: "/backup": stat /backup: no such file or directory: unknown

I assume this is because it's not actually using the right container as I have tried an absolute path too.

I am able to do said action manually via
docker compose exec backup /backup my_container

services:
ofelia:
image: mcuadros/ofelia:latest
command: daemon --docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
my_container:
image: my_container:latest
restart: always
labels:
ofelia.enabled: "true"
ofelia.job-exec.backup-pg1.schedule: "@every 2m"
ofelia.job-exec.backup-pg1.command: "/backup my_container"
ofelia.job-exec.backup-pg1.container: backup
backup:
image: backup:latest
container_name: backup
build: ../
restart: "no"
volumes:
- /opt/backups:/backups
- '/var/run/docker.sock:/var/run/docker.sock'