mcuadros / ofelia

A docker job scheduler (aka. crontab for docker)
MIT License
3.04k stars 175 forks source link

job-run add label to container #231

Open M1scer opened 1 year ago

M1scer commented 1 year ago

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:

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 commented 1 year ago

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.