본문 바로가기
Development/Docker&Kubernetes

Docker Image export 방법

by 폴피드 2022. 5. 11.
728x90
반응형
  • Image 를 export 하는 방법

docker save [option] [tar filename] [image name]

REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
nginx        latest    fa5269854a5e   2 weeks ago   142MB

docker save -o test.tar fa5269854a5e

 

  • 실행중인 컨테이너를 export 하는 방법

docker export [container name or containter ID] > [tar filename]

CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS          PORTS                NAMES
791601bf0587   nginx:latest   "/docker-entrypoint.…"   33 minutes ago   Up 33 minutes   0.0.0.0:80->80/tcp   mystifying_benz

docker export 791601bf0587 > test.tar

 

 

728x90
반응형