Skip to content

Conversation

@jonasengelmann
Copy link

Allow environment variables to be used in a schedule.ini file.

schedule.ini

[job-run "print-write-date"]
schedule = @every 5s
image = ${IMAGE} 
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -e IMAGE=ubuntu:latest mcuadros/ofelia:latest

See also this comment: #28 (comment)

@taraspos
Copy link
Collaborator

taraspos commented Mar 2, 2025

Have you tried to make this work using docker-compose and docker labels instead?

@jonasengelmann
Copy link
Author

I tried, but it did not allow me to use an env variable within a volume path. Trying to bind multiple volumes gets rather messy too.

@taraspos
Copy link
Collaborator

@jonasengelmann I just added integration test using docker-compose.
You can see example of variable expansion in there, it is quite flexible:

Would this be helpful for your use-case?

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

Successfully merging this pull request may close these issues.

2 participants