Load Docker Image From Tar File

Load Docker Image From Tar File

A tar is an archive file (.tar) that allows to store a collection of files and directories. Docker allows loading image from a tar file. This tutorial demonstrates how to do that.

Load image from tar file

To load the Docker image from a tar file, use docker load command or docker image command with load argument. The file name can be provided with -i option. For example, to load an image from the nginx_backup.tar file, you can use:

docker load -i nginx_backup.tar
docker image load -i nginx_backup.tar

The < redirection operator can be used as well to provide a tar file:

docker load < nginx_backup.tar
docker image load < nginx_backup.tar

Load image from tar gz file

Docker allows loading an image from a tar file even if compressed with gzip, bzip2, or xz.

docker load -i nginx_backup.tar.gz
docker image load -i nginx_backup.tar.gz

Leave a Comment

Cancel reply

Your email address will not be published.