Docker Image save & load

Poit·2023년 11월 15일
post-thumbnail

개발서버에서 빌드한 docker base image를 저장하고
배포서버에 해당 이미지를 load 하는 과정을 정리했습니다.



☑️ 개발 서버에서 docker image save


docker images

-> 개발 서버의 docker imgae 목록을 확인합니다.



docker save -o <myimage.tar> <myimage:latest>

-> 저장하고자 하는 image 들을 모두 해당 명령어로 저장해줍니다.


myimage.tar = 저장될 파일명
myimage:latest = 저장할 이미지명

이미지명은 [ REPOSITORY:TAG ] 의 조합입니다.

저장한 .tar 파일들을 배포 서버로 옮겨줍니다.




☑️ 배포 서버에서 docker image load


저장한 이미지.tar 파일이 있는 경로로 진입합니다.


docker load -i <file.tar>

-> 해당 명령어로 이미지를 load합니다.


docker images

-> 이미지가 정상적으로 load 되었는지 확인해봅니다.




We must all suffer one of two things: the pain of discipline or the pain of regret or disappointment.
-Jim Rohn

0개의 댓글