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-exec with swarm container #98

Open
sgohl opened this issue Apr 27, 2020 · 4 comments
Open

job-exec with swarm container #98

sgohl opened this issue Apr 27, 2020 · 4 comments

Comments

@sgohl
Copy link

sgohl commented Apr 27, 2020

I want to execute mongodump in a swarm container @daily.
As you know, swarm containers are named randomly.

how does this work with ofelia? Is there some kind of filter available, like we use to do this ?

docker ps -f name=mongo1
[job-exec "mongodump"]
schedule = @daily
container = mongo_mongo1.1.f0dmbbmxwza22tzqfhnopzt3f
command = mongodump

you see, that cant go well for very long ...

@taraspos
Copy link
Collaborator

Hey @Port22
there is no exec for swarm jobs. But what you can try is something like

[job-service-run "mongodump"]
schedule = @daily
image = mongo
network = mongo_network
command =  mongodump -h mongo ...

this will create another swarm service, so you need to make sure it can connect to your Mongo DB.

Not sure if it will satisfy your requirement, but I think that is the only option for now.

@sgohl
Copy link
Author

sgohl commented Apr 27, 2020

hey thanks for that fast answer!

That was actually my first try, but how do I mount a volume into that freshly created service?
for the dumps output ...

@taraspos
Copy link
Collaborator

I was afraid you would ask that 😅

Ofelia has no support of mounting volumes yet, unfortunately. #70

@4n70w4
Copy link

4n70w4 commented Aug 19, 2020

the same issue

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

3 participants