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

job-run add label to container #231

Open
M1scer opened this issue Aug 4, 2023 · 1 comment
Open

job-run add label to container #231

M1scer opened this issue Aug 4, 2023 · 1 comment

Comments

@M1scer
Copy link

M1scer commented Aug 4, 2023

i use the job-run to start an php container and run a php script every 5 minutes.

the docker run command should be something like this:
docker container run --rm --hostname testHostname -volume /mnt/point:/ofelia/php --label traefik.http.services.php.loadbalancer.server.port=80 php:8.2-cli /ofelia/php/update.php

my labels in the the docker-compose.yaml for ofelia are like this:
services:
ofelia:
....
labels:
- "ofelia.job-run.netcupDns.schedule=@every 5m"
- "ofelia.job-run.netcupDns.image=php8.2-cli"
- "ofelia.job-run.netcupDns.volume=/mnt/point:/phpscripts"
- "ofelia.job-run.netcupDns.command=/phpscripts/update.php"

Now everything looks fine exept the --hostname testHostname and --label traefik.http.services.php.loadbalancer.server.port=80

How do i add those labels to the container i am going to run?

@jsixface
Copy link
Contributor

I have a similar use case where I run a kopia backup job from a container. The backups get tagged with the hostname of the container. I would like to pass in a hostname config to set the hostname of the instantiated container.

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