Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Save and load the Docker image


May 22, 2021 Docker From entry to practice



Save the mirror

If you want to export a mirror to a local file, you docker save command.

$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              14.04               c4ff7513909d        5 weeks ago         225.4 MB
...
$sudo docker save -o ubuntu_14.04.tar ubuntu:14.04

Load the mirror

You docker load to import from an exported local file to a local mirror library, for example

$ sudo docker load --input ubuntu_14.04.tar

Or

$ sudo docker load < ubuntu_14.04.tar

This imports the mirror and its associated metadata information, including labels, and so on.