Looking for a basic "how to schedule a container" via Portainer.. Tons of fantastic documentation, but nothing that really helps with how to perform a basic task like this.
I believe I can use Edge Jobs to schedule this, but if you have any other ideas I am open to this. Including building a container that performs my scheduling tasks if that is possible, run into problems with access to the docker Daemon :)
Would like to run my exiting container instead of deploying a new one.
Thanks in Advance!
- Tried to run a docker container to schedule what I wanted but needed access to the docker daemon
- Asked OpenAI
- Tried searching for anything on the topic
- Tried searching in the official documentation
Sooooo.. After a journey!! I have my solution.
I wanted more control than what Portainer was offering. I have a script that works, and due to my network implementation I have not yet got it working in a container but it will be possible.. Attached is my Python code.
Notes -
2.environment_id.. This one isn't easy to find. Simply keep counting up until you find yours as it seems to be based on how many attempts you made to connect to an environment.. Turns out It took me three goes
3.Provision an API key. Top right when signed into Portainer you can select "My a Account" in the drop down and simply create an Access token under "Access tokens" Give this code to "portainer_api_key" in my script under "# Portainer API details" at the top
Happy coding!! Tones of other things you can do on API so might find this better than trying to work with Native Portainer management......