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

Running ofelia when a container is stopped? #94

Open
gremo opened this issue Feb 18, 2020 · 6 comments
Open

Running ofelia when a container is stopped? #94

gremo opened this issue Feb 18, 2020 · 6 comments
Labels

Comments

@gremo
Copy link

gremo commented Feb 18, 2020

I know that this is probably a weird question and that is something more related to the host OS scheduler... anyways, would be possible use ofelia to just start a container?

There are a lot of Docker images which just starts, do their job (probabily using an entrypoint script)... and then... exit.

@kamko
Copy link

kamko commented Feb 28, 2020

The main feature of Ofelia is the ability to execute commands directly on Docker containers. Using Docker's API Ofelia emulates the behavior of exec, be in able to run a command inside of a running container. Also you can run the command in a new container destroying it at the end of the execution.

or I'm missing what you're asking?

@taraspos
Copy link
Collaborator

@gremo, can you explain your use-case in more detail? @kamko is right, ofelia is designed to start containers.
Or you mean to start a container without specifying the command so it starts with the default one, which was set when container was built?

@gremo
Copy link
Author

gremo commented Feb 29, 2020

Thank you both. Maybe it's my english, I'll try to explain better... or maybe I'm missing somethig.

Take a simple image (container) that starts, do it's job, and then quits. If I schedule to run something in the container, using ofelia, will it work even if the container is stopped (not running at the time ofelia runs the job)?

@taraspos
Copy link
Collaborator

Hmmm... job-exec will not work, because it is impossible to exec into a stopped container. Docker will throw Error response from daemon: Container 1abc123 is not running.

@kamko
Copy link

kamko commented Mar 2, 2020

but if it is one-off container then you can simply create new container every run?

@magneticflux-
Copy link

I'm looking to do something like this as a workaround to #70.

I have a one-off container that needs environment variables, volumes, and to be run on a schedule. It doesn't seem like Ofelia can do this at the moment. The closest I can see would be job-run, but that seems to require the container to be named exactly (so Docker labels aren't as useful), and to be a "service container".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants