Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container service exit with status code 1 when ofelia.ini is empty: unable to start a empty scheduler #223

Open
gremo opened this issue May 15, 2023 · 1 comment

Comments

@gremo
Copy link

gremo commented May 15, 2023

I've Ofelia in my docker-compose.yml file:

ofelia:
  container_name: ${COMPOSE_PROJECT_NAME}-ofelia
  image: mcuadros/ofelia:latest
  volumes:
    - ./config/docker/ofelia.ini:/etc/ofelia/config.ini:ro
    - /var/run/docker.sock:/var/run/docker.sock:ro

Being a project skeleton, config/docker/ofelia.ini is empty. I don't know jobs definition in advance. This is a problem, since Ofelia service exit with status code 1 as soon as I do docker compose up -d:

app-ofelia | unable to start a empty scheduler.
app-ofelia exited with code 1

root@docker-ubuntu-s-1vcpu-1gb-intel-fra1-01:~/httpdocs/app# docker compose ps
NAME                COMMAND                  SERVICE             STATUS              PORTS
app-ofelia          "/usr/bin/ofelia dae…"   ofelia              exited (1)          

Is there any good reason to make it exit with status code 1 if no jobs are defined? ca you suggest a workaround not involving defining a fake job?

@jiangshengjun
Copy link

services:
  ofelia:
    image: mcuadros/ofelia:latest
    container_name: ofelia
    command: daemon --config=/etc/ofelia/config.ini
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./jobs.ini:/etc/ofelia/config.ini

The configuration I have is fine; when using config.ini, the --docker option cannot be used.

[daemon command options]
--config= configuration file (default: /etc/ofelia.conf)
-d, --docker read configurations from docker labels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants