-
Notifications
You must be signed in to change notification settings - Fork 0
Hello World Docker
Pull the Popcorn helloworld image from Docker hub
docker pull 123toorc/hcontainer-helloworld:hcontainerRun docker image, the Docker Container ID will return on standard output, ARM need add capabilities
docker run --cap-add all -d 083c6d4dfcb3
-> a40a7eb069172dc64dc771128cce91e942656f1cfe8b4d11ac97a99b08f64fd9Notify the process, docker-popcorn-notify takes 2 arguments, the Container ID(long or short), target archtecture.
cd hcontainer-tutorial
./docker-popcorn-notify a40a7eb069172d x86-64After notify succeeded, use docker checkpoint create to create a checkpoint, name is last arg (we name it as simple in this example)
docker checkpoint create a40a7eb069172d simpleCall recode script to recode the image file, it will copy the image file to current directory. recode.sh take 3 args, 1.Container Id (long or short) 2.Checkpoint name 3.Target archtecture
cd scripts/
./recode.sh a40a7eb069172d simple x86-64recode.sh will take take the checkpoint, and the output directory will be generated in /tmp Send recode checkpoint images to target machine
scp -r /tmp/simple $target@x86_machine:~Login to target machine
ssh $target@x86_machineIn target machine still need a same container, run the image just pulled, and stop the container before the restore.
docker pull 123toorc/hcontainer-helloworld:hcontainer
docker run --cap-add all 0beb2a3a9474
-> 7637bbed740829f374c7ff365b171f387206acccb1b604af3b87ab537bbc44d2
docker container stop 7637bbed740829f374c7ff365b171f387206acccb1b604af3b87ab537bbc44d2Copy the checkpoint images to target machine container checkpoints directory
cp -r ~/simple /var/lib/docker/containers/7637bbed740829f374c7ff365b171f387206acccb1b604af3b87ab537bbc44d2/checkpointsContainer restart from checkpoint
docker container start --checkpoint simple 7637bbed74082If it shows running, which means migration successfully, also you can check popcorn-hello output in log file located in the container directory
docker psWe provide scripts that can help you to do migration easily. Nginx is not support by script The scripts intros:
- check.sh will help user check current Cgroup support
- builder.sh is helper to build H-container
- dump.sh can help you dump the container and recode image, generate the dumped images in current dir, with Container ID and executable file given
- recode.sh is for process dumped images and recode it this is needed also for manually Docker migrate
- restore.sh is for restore Hcontainer in remote machine
popcorn.sh will call these scripts separately.
popcorn.sh takes 2 <required arguments> and [2 optional arguments]
<container directory> <target machine> [-p] [port:port]
There is more detail if you do ./popcorn.sh -h
This is a simple try of helloworld and redis:
./popcorn.sh ./helloworld [email protected]
./popcorn.sh ./popcorn-redis [email protected] -p 6379:6379