본문 바로가기

docker

Docker 이미지 save/load

728x90

docker save

설명

도커 이미지를  tar로 압축 (streamed to STDOUT by default)

사용법

$ docker save [OPTIONS] IMAGE [IMAGE...]

옵션

Name, shorthand Default Description
--output , -o   Write to a file, instead of STDOUT

예시

>, --output, -o

$ docker save busybox > busybox.tar

$ docker save --output busybox.tar busybox

$ docker save -o fedora-all.tar fedora

$ docker save -o fedora-latest.tar fedora:latest

도커 이미지를 gzip을 이용한 방법

You can use gzip to save the image file and make the backup smaller.

$ docker save myimage:latest | gzip > myimage_latest.tar.gz

특정 태그 선택 방법

You can even cherry-pick particular tags of an image repository.

$ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy

 

 

 

docker load

설명

tar로 압축된 도커 이미지를 로드 (or STDIN)

사용법

$ docker load [OPTIONS]

옵션

Name, shorthand Default Description
--input , -i   Read from tar archive file, instead of STDIN
--quiet , -q   Suppress the load output

예시

$ docker load < busybox.tar.gz 

$ docker load --input fedora.tar

 

반응형