-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to avoid running a job at "docker compose up"? #3
Comments
See compose profiles. Those might be helpful. |
It does not help because when you use compose profiles, no container is created when you |
@sprat I've solved this problem by doing the following:
|
@rare-magma, that's an interesting idea, i will try this technique when I'll get back to my project. Thanks for the input! |
Imagine that I have a long running job, for example a backup sync to an online storage service or a disks scrubing task: I would like to avoid launching the job on
docker compose up
but wait until the scheduled time arrives (in this case, during the night...).One way to do that is to define a "do nothing/wait indefinitely" command by default in the service and use the
exec
mode to run the real command on schedule. But in this case, I cannot invoke the job manually withdocker compose run
/docker compose start
if I need/want to.So I would prefer using the
run
mode (which semantically is more astart
than arun
since no container is created for each run), but I can't find to way to avoid running the container atdocker compose up
time. And I don't see how it could be implemented either since the tool need a container to start which must have been previously created. But maybe someone will come up with an idea?The text was updated successfully, but these errors were encountered: