도커 저장 및 도커로드

원래 컨테이너 ID가 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

단계

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

도커로드 < /image/image_1.tar

check whether the image exist or not

도커 이미지

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

그러나 , if power abnormal happend , there will be some error when the contain start, 다음과 같이

[root @ localhost ~]# docker start abcdefabcdef

Error response from daemon: 이미 사용중인 주소

오류: 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.

답장을 남겨주세요