Product/Docker

[Docker] Image / Container 관리 (Export, Import, Save, Load)

Codit Develop 2021. 1. 7. 14:52
반응형

Docker Image

Save (Image -> tar)

# Docker save [option] [File Name] [Image Name]
Docker save -o nginx.tar nginx:latest

Load (tar -> Image)

# Docker load -l [tar] [File Name]
Docker load -l tar nginx.tar
# Docker load < [File Name]
Docker load < nginx.tar

Docker Container

Export (Container -> tar)

# Docker export [Container ID/Name]>[File Name]
Docker export nginx > nginx.tar

Import (tar -> Container Image)

# Docker import [File Name / URL] -[Container Name[:Tag Name]]
Docker import nginx.tar - nginx:backup20201126
반응형