So let me start with what I think is going on and then you guys/girls can correct me:

  1. Docker can be run on the command line to creates containers based on command line input including any settings needed by the container.
  2. Compose files are files that hold all the settings needed to both create the container(s) and the settings they need. They basically keep a permanent record of what you want done. This would allow users to share their compose files to facilitate someone else setting up the same containers. 3.Portainer is a GUI for all things Docker. It creates compose files for containers that were created within it’s framework.

So my questions are:

  1. I assume that any container(s) I create will show up in portainer whether I create them in docker manually, process them using a docker compose file, or create them in portainer itself.

  2. Is there a compose file generated whenever you deploy a container or stack if one was not used to create the container(s). It seems like this would be a nice feature to have since there are more than a few ways to create a container.

  3. Where are all these compose files stored? I get to decide where to store compose files I create, but where are the compose file generated by portainer? I read that they exist within the portainer container but I don’t know how to access them. opening a console in portainer didn’t work.

Yes, I am trying to run before walking but that’s just how I learn. Thanks

  • thenextguy@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago
    1. Yes

    2. Yes

    3. Yes, No

    4. Yes

    5. I don’t think Portainer creates compose files like that. It just talks to the Docker daemon directly.

    6. See above.

  • CHOPSTEEQ@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    My actual professional advice: cut portainer out of your learning. Stick to compose as your only docker abstraction and you’ll be a wizard in no time. I have portainer running in my sea of self hosted apps and never use it. If you let some app generate compose files for you, or even just blindly use an app’s example compose file, you’ll never fully understand what’s happening and it’ll make things much more difficult to debug.

    4: yes, every container will show up in portainer. 5: I don’t know 6: this is one of the reasons why I personally hate piling layers onto tools. Very often someone else’s opinion does not jive with mine.

  • Bassman1805@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    10 days ago
    1. Yes, portainer will see every container you make, regardless of how it was created.

    2. No, creating a docker container doesn’t make a compose file. It’s like cooking a meal doesn’t output a recipe.

    3. You can save the compose file(s) wherever you want, you just need to run “docker compose up” from that directory. If you make the container within portainer, I believe it stores the compose files in its own volume. Not sure about that, I keep my compose file separate from portainer for most services.

  • Voroxpete@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    Your specific questions have already been answered elsewhere in this thread, but I just want to add my usual plea to not use Portainer.

    I’ve spent a lot of time with Portainer, both in my homelab and at work, and in both environments I eventually replaced it with Dockge, which is far superior, both for experienced users and newbies.

    Basically, the problem with Portainer is that it wants you to be in an exclusive relationship with it. For example, if you create containers from the command like like you described, Portainer only has very limited control over them. Dockge, on the other hand, is very comfortable switching back and forth between command line and UI. In Portainer when you do create your compose files from the UI, it then becomes very difficult to interact with them from the command line. Dockge doesn’t give a shit, and keeps all the files in an easy location you choose.

    Dockge will also do what you described in 5) take a docker command and turn it into a compose file. And it gives you much better feedback when you screw up. All in all its just a better experience.

  • AMillionMonkeys@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    I use Portainer mainly to start / stop / restart containers without the mental load of using the command line. It works fine with Compose if you can get (or write) a yaml file for the container you’re interested in, or you can use it to pull from the repository and set everything up if you can’t. Portainer also gives you a nice, one-stop view of the current state of your containers. Basically, it can’t hurt to have it around.
    Personally, my favorite Docker management GUI is the one that comes with Synology NASes. It’s much less clunky that Portainer and iirc a little more powerful. But of course it only runs in their hardware.