How-To Move Docker Container to Another Host With their Data - Bind Mound method

Sdílet
Vložit
  • čas přidán 25. 08. 2024
  • How-To Move Docker Container to Another Host With their Data - Bind Mound method
    Commands needed to backup / snapshot a docker container and copy over to another host, deploy the snaphot docker image on new host and follow with manual data copy over to new host to maintain same data between the two hosts.
    ===========================
    Network Security courses on ElastiCourse/Udemy:
    Introduction to Fortigate Firewall
    www.elasticour...
    www.udemy.com/...
    Fortigate Advanced Configuration
    www.elasticour...
    www.udemy.com/...
    Introduction to FortiManager course
    www.elasticour...
    www.udemy.com/...
    ===========================
    AWS Web Application deployment and migration course
    www.elasticour...
    www.udemy.com/...

Komentáře • 49

  • @LoWangSmg
    @LoWangSmg Před měsícem

    Best explanation so far ! Thanks

  • @Vandy5000
    @Vandy5000 Před 4 lety +7

    This is the best video I found for me (a beginner) to understand.

  • @geetharaghuram8887
    @geetharaghuram8887 Před 3 lety +2

    This is life saver to me! I am beginner and creating a docker project. Created an nginx customized image and did not have idea on how to package along with the html. Thanks a zillion!!

  • @arex2006
    @arex2006 Před 2 lety +1

    great, greater, you are the greatest. With this video i was able to smoothly migrate my containers from old dell t7500 with a lot of power consumed to a brand new dell wyse 5070 running xpenology with only 10W TDP

  • @jamesT008
    @jamesT008 Před 2 lety

    Precise information...no hunky junky talk. Apreciated!

  • @bhaveshjoshi5028
    @bhaveshjoshi5028 Před 3 lety +1

    Was searching for a simple and to the point video - found it here ., Many Many Thanks - please make more videos..,!!

  • @andresantana9148
    @andresantana9148 Před 2 lety

    I wish I could like 1000x because this video was super useful.
    Thank you.

  • @pitwyman
    @pitwyman Před 6 měsíci

    I didn't know you could go from a container on Linux to a container on Windows ! thanks for the tips ;)

  • @fithawighide6589
    @fithawighide6589 Před 2 lety

    Thank you for making this video.

  • @umitkirtil
    @umitkirtil Před 2 lety

    thank you so much. you are a life saver

  • @MAXimator70
    @MAXimator70 Před 2 lety

    thanx a lot for this awesome tutorial!

  • @victorcandiani
    @victorcandiani Před rokem

    Man, you're fucking awesome. Congrats.

  • @mridulchoudhary3010
    @mridulchoudhary3010 Před 3 lety

    Thanks a ton !!! I just started learning Docker & was having this doubt
    about packaging the container along with data stored in corresponding volumes .
    It would be really helpful if you could create a full series on Docker , Docker-compose .

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      Sure. I have 4 videos on Docker so far, with more to come.

  • @killua_148
    @killua_148 Před 9 měsíci

    Hi, why do you use docker commit instead of using the official image? Isn't just copying the bind mounts enough?

  • @swarnashissarkar4767
    @swarnashissarkar4767 Před 3 lety

    Excellent!!!

  • @berizzian
    @berizzian Před 3 lety

    Great video. Im thinking twice about using docker for some production applications its really concerning to see containers are not really self contained. They are still fun though :)

  • @vladyslavliebiediev8057

    Thank you.

  • @philsipad
    @philsipad Před 3 lety +2

    You left out the most important piece - moving the volumes and deal with the file access attributes aftermath. There is really no need to move the container as you can always pull a new container from the docker hub on the new host. The volumes are what hold the data that define the system.

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      Correct, volumes are important piece to move as well, but unfortunately there is no simple way to move them other than copying them over manually or using paid 3rd party services.

  • @jai-yadav
    @jai-yadav Před 3 lety

    Perfect! 👌🏻

  • @dazzler9264
    @dazzler9264 Před rokem

    is there any another way,,,because i got question in interview

  • @BrianThomas
    @BrianThomas Před rokem

    Thank you for the video. Does it make a difference if I used Yacht to install the container? I have 1 container that has about 100G of data that I need to move to another machine so that I can nuc it and install a different OS on it. I was just looking for a simple way of doing it.

  • @jkdjdon
    @jkdjdon Před 3 lety +1

    I'm not getting bind mounts on save! Like you got in dns folder. Is there anything I'm doing wrong?

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      Can you show me you docker run command to verify, you could be using wrong syntax in the -v command, which differs based on OS type (Windows, Mac. Linux)

  • @aszuts
    @aszuts Před 2 lety

    Very nice work! One key point for me: I have to copy the docker run parameters with my image. (all the port mappings, volume mappings etc.)
    Without run parameters it is only an image. I wonder why there is no option to export container start parameters. It would be easier to share containers with my colleagues.

    • @ElastiCourse
      @ElastiCourse  Před 2 lety +1

      you can save a container with all the custom ports and everything using Docker Compose, you just create a text file in YAML format with all that. Example on Pi-hole here github.com/pi-hole/docker-pi-hole

  • @ariefilkom46
    @ariefilkom46 Před 3 lety +1

    now that the container in your windows env use the pieholebackup image, what do you do if you want to use the latest piehole (official) image then?

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      very good question. Follow the steps in this video first to migrate the container to another host, then follow this video to update to newer images when available czcams.com/video/76Xctfb_qI8/video.html

  • @shaunpx1
    @shaunpx1 Před rokem

    Where did you copy the dns folder on windows? Did you zip and copy the files over? Did you unzip then on the desktop? The pwd shows etc-bin not bin?

  • @ElastiCourse
    @ElastiCourse  Před 4 lety +2

    *Please note:*
    *docker save [image] > file.tar* followed by *docker load < file.tar*

    Might not work if the save and load are executed on a different OS.
    Always use:
    *docker save [image] -o file.tar* followed by *docker load -i file.tar*

  • @larrybud
    @larrybud Před 3 lety

    it's crazy there's not an import/export container function which saves all of the settings. What a PITA

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      I always thought the same. It's complicated for one script to be able to accommodate all different variables and settings one can add to a container run config, unless built by Docker directly. It gets even worse when said container is part of a stack (Docker Compose) or project name. If you can get used to writing a little bit more code you will really enjoy Docker.

  • @premkumarmani1380
    @premkumarmani1380 Před 2 lety

    hope we can use the same steps if I migrate the base machine from centos to ubuntu?

    • @ElastiCourse
      @ElastiCourse  Před 2 lety

      Centos use different package manager and different shell commands, by SQL commands and docker commands should be exactly identical

  • @MrRuffythemonkey
    @MrRuffythemonkey Před 3 lety

    who makes the backups of images that are always available. It would be more interesting how one can store containers variably.

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      Can you elaborate more on what you mean by storing containers variably? Container images and container data are independent.

    • @MrRuffythemonkey
      @MrRuffythemonkey Před 3 lety

      @@ElastiCourse environment variables and networksettings etc. for example passwords Sql password etc.

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      The best solutions for storing sensitive information like SQL passwords would be:
      1. Docker Secrets (Requires Swarm services to be enabled)
      2. Kubernetes Secrets (Requires kubectl)
      3. HashiCorp Vault (3rd party, same company that makes Terraform)

  • @joshuasmith2814
    @joshuasmith2814 Před rokem

    great video but man is docker a PITA to work with, there's got to be a better way to manage containers than this.

    • @ElastiCourse
      @ElastiCourse  Před rokem +1

      There is a learning curve, but I must appreciate what Docker brings to the table from ultra speed to reliability and ease of use. For easier solutions to get used to it check my other video on using Docker easy GUI with templates czcams.com/video/gQiIVzNc_go/video.html

  • @honaga79
    @honaga79 Před 3 lety

    tuyệt vời

  • @guyh3403
    @guyh3403 Před 3 lety

    For some reason I get an error when saving the .tar "no space left on device".
    I run Docker on a Synology 218+ with 10Gb ram. The Image is approx 1Gb.
    /dev/md0 is at 100% Odd huh?

    • @ElastiCourse
      @ElastiCourse  Před 3 lety

      I'm not sure about docker limitation on Synology devices. You should have no issues running that image on a windows, mac or linux with Docker Engine running.

    • @guyh3403
      @guyh3403 Před 3 lety

      @@ElastiCourse Got an easy fix for future reference.
      Save the file outside $pwd at /volume1/...

  • @tecint
    @tecint Před 2 lety

    Where is the video content in files?

  • @dazoedave
    @dazoedave Před 3 lety

    Title should be How-To Move Docker Container to Another Host With *Bind Mounts*