.nh .TH "DOCKER" "1" "Jan 2024" "Docker Community" "Docker User Manuals" .SH NAME .PP docker-image-import - Import the contents from a tarball to create a filesystem image .SH SYNOPSIS .PP \fBdocker image import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]\fP .SH DESCRIPTION .PP Create a new filesystem image from the contents of a tarball (\fB\&.tar\fR, \fB\&.tar.gz\fR, \fB\&.tgz\fR, \fB\&.bzip\fR, \fB\&.tar.xz\fR, \fB\&.txz\fR) into it, then optionally tag it. .SH EXAMPLES .SH Import from a remote location .EX # docker image import http://example.com/exampleimage.tgz example/imagerepo .EE .SH Import from a local file .PP Import to docker via pipe and stdin: .EX # cat exampleimage.tgz | docker image import - example/imagelocal .EE .PP Import with a commit message. .EX # cat exampleimage.tgz | docker image import --message "New image imported from tarball" - exampleimagelocal:new .EE .PP Import to a Docker image from a local file. .EX # docker image import /path/to/exampleimage.tgz .EE .SH Import from a local file and tag .PP Import to docker via pipe and stdin: .EX # cat exampleimageV2.tgz | docker image import - example/imagelocal:V-2.0 .EE .SH Import from a local directory .EX # tar -c . | docker image import - exampleimagedir .EE .SH Apply specified Dockerfile instructions while importing the image .PP This example sets the docker image ENV variable DEBUG to true by default. .EX # tar -c . | docker image import -c="ENV DEBUG=true" - exampleimagedir .EE .SH When the daemon supports multiple operating systems .PP If the daemon supports multiple operating systems, and the image being imported does not match the default operating system, it may be necessary to add \fB--platform\fR\&. This would be necessary when importing a Linux image into a Windows daemon. .EX # docker image import --platform=linux .\\linuximage.tar .EE .SH See also .PP \fBdocker-export(1)\fP to export the contents of a filesystem as a tar archive to STDOUT. .SH OPTIONS .PP \fB-c\fP, \fB--change\fP= Apply Dockerfile instruction to the created image .PP \fB-h\fP, \fB--help\fP[=false] help for import .PP \fB-m\fP, \fB--message\fP="" Set commit message for imported image .PP \fB--platform\fP="" Set platform if server is multi-platform capable .SH SEE ALSO .PP \fBdocker-image(1)\fP