Export Docker Container Settings as Docker Compose Stack

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2025

ความคิดเห็น • 63

  • @TwiggehTV
    @TwiggehTV ปีที่แล้ว +23

    Why isnt this in Portainer by default? There should be a button when you view a container saying "generate new stack" that gives you a window to set a name for the stack, aswell as add additional containers to the stack.
    Thanks for the video, this helps alot!

  • @rajivvishwa
    @rajivvishwa 3 ปีที่แล้ว +3

    This is fantastic. I used to create containers directly in the past until I learned about stacks. I'll dump all my non stack containers as per the method you have described here and redeploy as stacks. That gives me flexibility to deploy it to a different endpoints configured in portainer.

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว

      Awesome!

    • @rodrigocarof
      @rodrigocarof 3 ปีที่แล้ว

      @@DBTechYT i used this method to backup my containers but it doesn't show the network configuration of my containers that are under gluetun. How do i put that network configuration on a stack?

  • @PoeLemic
    @PoeLemic 3 ปีที่แล้ว

    This is really awesome. I'm trying to learn how to use Portainer from watching YT videos. This helps me understand how to do many things. Thank you. This is best video on YT for this subject.

  • @rynofly
    @rynofly 10 หลายเดือนก่อน

    Thanks for this video. I had been using portainer to prototype a few services, and wanted to export everything so I could construct a single stack. The output wasn't perfect of course, but after about 45 minutes of comparing against the compose files I started with, I was able to find my additions (stuff I did via portainer ui), integrate them and assemble them into a single compose file!

    • @DBTechYT
      @DBTechYT  10 หลายเดือนก่อน

      Glad it helped!

  • @gunterdevlieger1913
    @gunterdevlieger1913 3 ปีที่แล้ว

    Thx very good way to save everything so you don't have to look everything up again. Really love your home server vids also. Learned a lot of it

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว

      Glad to help

  • @bracketk
    @bracketk 3 ปีที่แล้ว +2

    THANK YOU! I have been looking for a way to do this. Sure makes backing up the setup easier. Just can't remember all the changes when I have to redeploy a container.

  • @televisi
    @televisi 11 หลายเดือนก่อน

    Thanks, great video instruction and gives the idea on how to do reverse docker-compose from an existing container

    • @DBTechYT
      @DBTechYT  11 หลายเดือนก่อน

      Glad it was helpful!

  • @chrisumali9841
    @chrisumali9841 3 ปีที่แล้ว

    Thanks for the demo and info. If you do a > [to file].yaml you can save the files directly. Have a great day

  • @TechNPLUS
    @TechNPLUS 3 ปีที่แล้ว +3

    Interesting! You can add your “dbtech” user to the docker group with this command “sudo usermod -aG docker dbtech” so that you don’t have to put sudo each time in front of your docker commands.

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว +2

      That's a great idea! Hadn't thought of it, so thank you!

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว

      Actually just tried and got this:
      sudo: usermod: command not found
      Must be a Synology issue as I've done stuff like this on other systems in the past.

    • @TechNPLUS
      @TechNPLUS 3 ปีที่แล้ว

      @@DBTechYT it always works fine on either Debian or Ubuntu, try it with your root user without "sudo" -->> usermod -aG docker dbtech

    • @TechNPLUS
      @TechNPLUS 3 ปีที่แล้ว

      One last thing, you can edit the user using the Synology UI, control Panel --- >> User Group Tab

    • @chandrakiran2796
      @chandrakiran2796 3 ปีที่แล้ว

      login as root and run the same command, if you cant use su- and not su. That error is coz usermod is in /usr/sbin and not /usr/bin.

  • @mrbarrington-smythe9033
    @mrbarrington-smythe9033 2 ปีที่แล้ว +2

    Just what I was looking for. Thanks. Would also be a good feature request for Portainer, to be able to just click an 'export container to docker-compose file' button.

    • @DBTechYT
      @DBTechYT  2 ปีที่แล้ว

      Great suggestion!

    • @mrbarrington-smythe9033
      @mrbarrington-smythe9033 2 ปีที่แล้ว

      @@DBTechYT Sorry about the autotype. Have now corrected my original comment.

  • @try-that
    @try-that 3 ปีที่แล้ว +2

    You could write or append directly to a file by using '| tee file.txt' or '| tee -a file.txt' where file.txt will be in the current folder and be read

  • @ajballa555
    @ajballa555 ปีที่แล้ว

    Combining the output of this and using codepal to help tidy some of the file up got me to a workable stack pretty fast thanks for the info

  • @andrewpndavies
    @andrewpndavies 3 ปีที่แล้ว

    Great video as always and something I have often wanted to work out how to do. So confused about the difference between stacks and docker-compose files though!

  • @jimdavis3749
    @jimdavis3749 3 ปีที่แล้ว

    Been trying to figure out how to do docker compose with Portainer for awhile. Brilliant. Thanks!!

  • @gregloin3658
    @gregloin3658 2 ปีที่แล้ว

    great video great demonstation and comments

    • @DBTechYT
      @DBTechYT  2 ปีที่แล้ว

      Much appreciated

  • @pikuzheng6548
    @pikuzheng6548 2 ปีที่แล้ว

    nice job! you saved my time

  • @iAbdulla_AJ
    @iAbdulla_AJ 3 ปีที่แล้ว +1

    Nice video motivated me to build a home security lab as well, but I would like to ask you if you have any tools you used to monitor the network and the endpoints and containers in your lab. Could you please make a video to show that

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว +3

      I've actually got a couple of videos coming up for monitoring purposes

    • @iAbdulla_AJ
      @iAbdulla_AJ 3 ปีที่แล้ว

      @@DBTechYT thank you for your quick response, that will be nice to cover the security monitoring 👍

    • @PoeLemic
      @PoeLemic 3 ปีที่แล้ว +1

      @@DBTechYT Yes, Abdulla, has a great idea. I would like a way to have each of my Windows devices tell some container on the network that they are alive and what their network speed is. Because, sometimes, my Win boxes don't send stuff at gigabit speed but at 100 mbit speed. Dont' know why. I have to release the network device and reinstate it, then it works for a random period of days. But, be nice to have a monitoring system that'd poll the devices every few hours to check that devices are up & running, also what their network speed is. Is there anything for that? And, if so, please make a video about that. Thanks.

  • @cloudsystem3740
    @cloudsystem3740 3 ปีที่แล้ว

    thank you very much! really an epic video

  • @markloughtonUK
    @markloughtonUK 3 ปีที่แล้ว

    Just tried this but it doesnt work on the Pi4 (Arm processor). It's only for linux/amd64 :(

  • @jossevriens3624
    @jossevriens3624 3 ปีที่แล้ว +1

    Is version 3 possible in portainer ?, i gues not so why export to v3 ?

    • @MiscSimon
      @MiscSimon 3 ปีที่แล้ว

      Portainer CE 2.1.1 now supports Compose up through v3.8 for standalone hosts!

  • @genestarwind4610
    @genestarwind4610 3 ปีที่แล้ว

    How do you put containers into a stack?
    Would you export them like this then delete the containers and go to add stack?

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว

      This is more for having a quick way to redeploy containers later, not replace them for the sake of replacing them

    • @genestarwind4610
      @genestarwind4610 3 ปีที่แล้ว

      @@DBTechYT Ok how to do you add stand alone containers to a stack?
      Or add more containers to a stack.
      I am looking through portanier and can't see how to edit the stack file

    • @genestarwind4610
      @genestarwind4610 3 ปีที่แล้ว

      @@DBTechYT Ok I went into portainer the container and edit the "labels" option it is now in the stack

    • @genestarwind4610
      @genestarwind4610 3 ปีที่แล้ว

      @@DBTechYT I been trying to read more still new.
      But stacks are nothing special right except for loading all the compose files in 1 place.
      Nothing special about resource management or permission?
      Is there any way to go to the containers tab and just select add to ''stack"

  • @AtomEngineer
    @AtomEngineer 3 ปีที่แล้ว +2

    if only there was an armv7 build for raspberry pi. This is great though!

  • @jojohnes5863
    @jojohnes5863 8 หลายเดือนก่อน

    Adding this generated output to a stack in portainer, portainer will not "activate" the deploy stack button

    • @DBTechYT
      @DBTechYT  8 หลายเดือนก่อน

      Okay. This video is more than 3 years old at this point. And looking at the hub.docker.com page for it, the container hasn't been updated in about 3 years as well (hub.docker.com/r/red5d/docker-autocompose). I honestly am not surprised, based on that alone, that it doesn't work properly.

    • @jojohnes5863
      @jojohnes5863 8 หลายเดือนก่อน

      @@DBTechYT : But the output of autocompose hsa not changed and the way of usings stacks hasn`t changed also. Didi you use the tool, or do you have alternative ways? Execpt building up thecontaiers step by step in portainer.
      Want o transfer some of them from my Raspi to a server on the web

  • @lucagarofalo4970
    @lucagarofalo4970 3 ปีที่แล้ว

    I was wondering if exist also the container for raspberry, do you know if it is available?

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว +2

      Not at the moment. Could probably be built to do it, but the developer hasn't done that yet.

  • @Teleport73
    @Teleport73 2 ปีที่แล้ว

    Thanks so much. Very useful. What's your preference on raising a stack? Do you prefer using Docker Compose, in the shell or adding the stack directly in Portainer?

    • @DBTechYT
      @DBTechYT  2 ปีที่แล้ว

      I prefer when I can do things in Portainer because I like the GUI, but I also don't mind doing things in command line. I think it's important to know how do things both ways.

  • @abdus-samad5
    @abdus-samad5 3 ปีที่แล้ว

    Hi. Can you make a video about running ntopng on docker on a raspberrypi ? Thanks

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว +2

      I'm planning on making an ntopng video soon, but the original image's OS/ARCH is limited to linux/amd64, so it won't work with Raspberry Pi

    • @abdus-samad5
      @abdus-samad5 3 ปีที่แล้ว

      @@DBTechYT Hi. I found this. Dont knw if will help github.com/lelmarir/ntopng-docker-raspberrypi

    • @abdus-samad5
      @abdus-samad5 3 ปีที่แล้ว

      @@DBTechYT I also find this one : github.com/ntop/docker-ntop

  • @abdullahazad
    @abdullahazad 3 ปีที่แล้ว

    that's awesome

  • @skynetdyson3970
    @skynetdyson3970 3 ปีที่แล้ว

    Nice!

    • @DBTechYT
      @DBTechYT  3 ปีที่แล้ว

      Thank you! Cheers!

  • @bepobonacic9791
    @bepobonacic9791 2 ปีที่แล้ว +1

    How did you know today is Friday? 😅

    • @DBTechYT
      @DBTechYT  2 ปีที่แล้ว +1

      😂🤣😂😂🤣🤣

  • @smhhoseinee
    @smhhoseinee 2 ปีที่แล้ว

    for windows ssh Mobaxterm is better than putty by far
    I highly recommend it and it has kept me satisfied all the time