Replies: 25 comments
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
Hi @itsconquest The discussion you linked sounds interesting as well, but in my case I was thinking more along the lines of being easily able to add/remove containers to/from stacks just by selecting them form the list and selecting the Stack to add/remove to/from. Like I mentioned, I'm still pretty new to this, but from my understanding so far, stacks are basically meant as a way to start/stop a selected list of containers as a single group. In my use case scenario I could create a "HTPC" stack (group) within Portainer, then select the containers to add to that stack right from the list (or easily remove any of them later if so desired. It'd be a lot easier than hand coding/editing a docker compose file all the time. then whenever I want I can just start/stop groups as desired. You might've already understood what I meant the first time, but just in case, I'm adding this for the sake of clarity anyway. :p |
Beta Was this translation helpful? Give feedback.
-
Yeah, I wish there were available as well. +1 |
Beta Was this translation helpful? Give feedback.
-
I just ran into this as well. Found this issue searching Google for a way to add a container to a stack. In my case I have a stack that was using MySQL db. The stack was created outside of Portainer. Now I've created a Mongo db to use instead. I'd like to add the new db to the stack so I can turn it on/off with the rest of the stack. If nothing else it would be nice from a categorization perspective to have all related items in the same stack. |
Beta Was this translation helpful? Give feedback.
-
After spending time learning Docker more since my first post, this still does seem doable, but it would take a bit of time to code it all up. Basically you'd have to read a checked container's run arguments, format it into Compose format, then add it to the compose file, behind the scenes. Off the top it doesn't seem too tricky, but of course as any coder knows, nothing ever goes smoothly right off the bat, lol. |
Beta Was this translation helpful? Give feedback.
-
+1 for this feature. |
Beta Was this translation helpful? Give feedback.
-
This feature will be well appreciated, hope it can be added!!!! |
Beta Was this translation helpful? Give feedback.
-
I agree!! This is top feature! )) |
Beta Was this translation helpful? Give feedback.
-
I really wanted this function too. I had to go back and go one-by-one container and create a stack from scratch. Ended up being less daunting than I thought, but only because of this tool: https://github.com/Red5d/docker-autocompose Wasn't perfect, but if you add to stack one container at a time and make sure it runs/functions okay... you'll finally have a docker-compose file that'll be a good backup of settings too. Wish I knew about stacks before just adding a bunch of containers willy nilly. :P |
Beta Was this translation helpful? Give feedback.
-
The docker-autocompose image is cool, but it doesn't pull out network (and maybe other config), so I've written a little script that outputs the full network config alongside the autocompose info, which you can then use to build a fuller compose file. https://github.com/ptruman/dockerconfig/blob/main/getdockerconfig.sh |
Beta Was this translation helpful? Give feedback.
-
+1 for this add to stack feature by selecting containers |
Beta Was this translation helpful? Give feedback.
-
I would like to have that feature too! |
Beta Was this translation helpful? Give feedback.
-
Googled how to do this - this issue came up. This would be very helpful if it was a possibility! EDIT: |
Beta Was this translation helpful? Give feedback.
-
Hi sorry for the wakeup on this. Your script seems interesting but the network config files you generate, can also be restored in Portainer? I was looking for the best way to backup every container using Portainer, and I was thinking on making a Stack using the output from your script. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi
It only uses the docker CLI to output the info, it doesn't do any form of
restore, and no docker command reads config back in to re-build, outside of
compose files.
The red5 container output (which my scripts calls to generate) gets "most
of what you need" to get running, and then you can use the network txt file
to amend config.
I don't think red5 does it "as is" because you could restore a container
and make it inaccessible (or not start) if it's not on the exact same
machine - and docker is about 'state' for the most part.
You could probably write a bit of additional script to just copy the
"networks" section from the INSPECT file to the COMPOSE file and see if
that behaved?
…On Sat, 23 Jul 2022 at 14:59, GitGat ***@***.***> wrote:
I really wanted this function too. I had to go back and go one-by-one
container and create a stack from scratch. Ended up being less daunting
than I thought, but only because of this tool:
https://github.com/Red5d/docker-autocompose
Wasn't perfect, but if you add to stack one container at a time and make
sure it runs/functions okay... you'll finally have a docker-compose file
that'll be a good backup of settings too. Wish I knew about stacks before
just adding a bunch of containers willy nilly. :P
The docker-autocompose image is cool, but it doesn't pull out network (and
maybe other config), so I've written a little script that outputs the full
network config alongside the autocompose info, which you can then use to
build a fuller compose file.
https://github.com/ptruman/dockerconfig/blob/main/getdockerconfig.sh
Hi sorry for the wakeup on this. Your script seems interesting but the
network config files you generate, can also be restored in Portainer?
I was looking for the best way to backup every container using Portainer,
and I was thinking on making a Stack using the output from your script.
Thanks
—
Reply to this email directly, view it on GitHub
<#2845 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPGIY5E2GNKTPIXHWG5CUDVVP3EFANCNFSM4HHPR5QQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I use app templates to create instances of my app. Sometimes I want to add a UI container that connects to a specific instance, so I'd like to be able to add that new container to the already existing stack, to be able to group containers, but I'd prefer to add everything to a stack, so I can easily stop or restart the entire stack. To be clear: I would like to be able to add a container to an existing stack. |
Beta Was this translation helpful? Give feedback.
-
are the devs considering adding this functionality? |
Beta Was this translation helpful? Give feedback.
-
Vote +1 for this feature. |
Beta Was this translation helpful? Give feedback.
-
Vote +1 This realy would be cool. |
Beta Was this translation helpful? Give feedback.
-
Vote +1 I just moved to Portainer and would have loved to have this before the move. |
Beta Was this translation helpful? Give feedback.
-
Another vote for a way to control stack boot order to avoid dependencies issues. I understand that the depends_on and additional docker features always relate to the same docker-compose (stack) but not between different stacks. |
Beta Was this translation helpful? Give feedback.
-
Vote +1 for this feature |
Beta Was this translation helpful? Give feedback.
-
Any news? Would love to see this functionality appear at some point :) |
Beta Was this translation helpful? Give feedback.
-
This would be handy to have! |
Beta Was this translation helpful? Give feedback.
-
I'm still pretty new to all this Docker and Portainer stuff; I have a list of running containers right now. About half are HTPC software containers, and a few others are software dev type containers. I know I can take a bunch of time out and hand code a docker compose file to create each stack, but is there a quicker/easier way to do so, such as simply putting a check on each container in the list that I want to include in a stack, clicking an edit button and automatically adding those checked containers to a stack?
Example, my list:

If I could just check a bunch of those, for instance, tautulli, ombi, hydra, meduas, lidarr, radarr, sonarr, and then do some sort of "add to HTPC stack" and have it do so, that'd be great. Possibly even generating the docker compose code automatically using each container's current Inspect info. Maybe it's already an available feature and I'm just not seeing it?
Beta Was this translation helpful? Give feedback.
All reactions