Docker speichern und Docker laden

Angenommen, die ursprüngliche Container-ID ist 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

SCHRITTE

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 laden < /image/image_1.tar

check whether the image exist or not

Docker-Bilder

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

Aber , if power abnormal happend , there will be some error when the contain start, wie folgt

[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.

Hinterlasse eine Antwort