docker save and docker load
suppose that original container ID is abcdefabcdef , I am gonna package this container to a image
whch named image_1, then I’ll upload image_1 to a destination server. the user of destination
server is user, and ip is ip2
STEPS
convert this container to an image
docker commit abcdefabcdef image_1
package this image, and save it to /image/
docker save -o /image/image_1.tar image_1_ID
upload this image to another docker physical server.
scp /image/image_1.tar -Pport user@ip2:/image/
load this image
docker load < /image/image_1.tar
check whether the image exist or not
docker images
make a tag for this image
docker tag image_1_ID image_1:v.x.x
run this images
docker run option -cap-add=NET_ADMIN image_1_ID
But , if power abnormal happend , there will be some error when the contain start, as follows
[root@localhost ~]# docker start abcdefabcdef
Error response from daemon: Address already in use
Error: failed to start containers: abcdefabcdef
If it’s not convenient to modify the internal file, you can migrate this image
to other server and load it , then startup this container.