Import Filesystem of Docker Container as Image From Tar File

Import Filesystem of Docker Container as Image From Tar File

A tar is an archive file (.tar) that allows to store a collection of files and directories. If a filesystem of Docker container has been exported to a tar file, it can be imported as Docker image. Later, a container can be created from specified image. This tutorial shows how to import filesystem of Docker container as an image from a tar file.

The docker import command, or docker image command with import argument, can be used to import filesystem of Docker container as an image from a tar file. For example, to import an exported container as an image nginxfs:latest from a tar file nginx_container.tar, you can use:

docker import nginx_container.tar nginxfs:latest
docker image import nginx_container.tar nginxfs:latest

Leave a Comment

Cancel reply

Your email address will not be published.