How-To Move Docker Container to Another Host With their Data - Bind Mound method
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/...
Best explanation so far ! Thanks
This is the best video I found for me (a beginner) to understand.
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!!
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
Precise information...no hunky junky talk. Apreciated!
Was searching for a simple and to the point video - found it here ., Many Many Thanks - please make more videos..,!!
I wish I could like 1000x because this video was super useful.
Thank you.
I didn't know you could go from a container on Linux to a container on Windows ! thanks for the tips ;)
Thank you for making this video.
thank you so much. you are a life saver
thanx a lot for this awesome tutorial!
Man, you're fucking awesome. Congrats.
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 .
Sure. I have 4 videos on Docker so far, with more to come.
Hi, why do you use docker commit instead of using the official image? Isn't just copying the bind mounts enough?
Excellent!!!
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 :)
Thank you.
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.
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.
Perfect! 👌🏻
is there any another way,,,because i got question in interview
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.
should be the same process.
I'm not getting bind mounts on save! Like you got in dns folder. Is there anything I'm doing wrong?
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)
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.
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
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?
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
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?
*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*
it's crazy there's not an import/export container function which saves all of the settings. What a PITA
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.
hope we can use the same steps if I migrate the base machine from centos to ubuntu?
Centos use different package manager and different shell commands, by SQL commands and docker commands should be exactly identical
who makes the backups of images that are always available. It would be more interesting how one can store containers variably.
Can you elaborate more on what you mean by storing containers variably? Container images and container data are independent.
@@ElastiCourse environment variables and networksettings etc. for example passwords Sql password etc.
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)
great video but man is docker a PITA to work with, there's got to be a better way to manage containers than this.
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
tuyệt vời
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?
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.
@@ElastiCourse Got an easy fix for future reference.
Save the file outside $pwd at /volume1/...
Where is the video content in files?
Title should be How-To Move Docker Container to Another Host With *Bind Mounts*
Makes more sense, thanks.