docker import: create an image from a tarball
Answer: docker import creates a filesystem image from the contents of a tarball. You can specify a file, a URL, or a dash to take data directly from STDIN. The --change option applies Dockerfile instructions to the created image.
Inputs and archives
The command imports tarball contents and builds a filesystem image from them.
You can specify a URL or a dash to take data directly from STDIN. A REPOSITORY and TAG may follow the file or URL.
The URL may name a filesystem archive, such as .tar, .tar.gz, or .txz, or an individual file on the Docker host.
An archive is untarred in the container relative to / . An individual file requires the full path within the host.
A remote import needs a URI that begins with the http:// or https:// protocol. This creates a new untagged image.
Change, message, and platform
The --change option applies Dockerfile instructions to the image that is created.
The --message option sets a commit message for the imported image.
The --platform option sets the platform for the imported image.
The daemon's native platform is the default. Override it when the imported root filesystem targets another architecture or operating system.
See also
Claims
- id: C1 claim: import creates a filesystem image from a tarball. source: S1 evidence: "Import the contents from a tarball to create a filesystem image"
- id: C2 claim: A dash takes data directly from STDIN. source: S1 evidence: "take data directly from STDIN"
- id: C3 claim: A remote URI should begin with http:// or https://. source: S1 evidence: "begins with the http:// or https:// protocol"
- id: C4 claim: --change applies Dockerfile instructions to the created image. source: S1 evidence: "applies Dockerfile instructions to the image that is created"
- id: C5 claim: --message sets a commit message for the imported image. source: S1 evidence: "Set commit message for imported image"
- id: C6 claim: By default the daemon's native platform is used. source: S2 evidence: "the daemon's native platform is used as platform"
Sources
- [S1] docker image import. Docker Docs. https://docs.docker.com/reference/cli/docker/image/import/ . License: Apache-2.0. Accessed 2026-11-23.
- [S2] docker import CLI reference. Docker CLI. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/image_import.md . License: Apache-2.0. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker image import; Docker CLI, docker import CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker image import; Docker CLI, docker import CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "docker import: create an image from a tarball." iinventedlight Library, iil:note:7zw113xn, version of 2026-11-23. https://iinventedlight.com/library/notes/docker-import/. License: CC-BY-4.0.
@misc{iil_note_7zw113xn,
author = {{iinventedlight}},
title = {{docker import: create an image from a tarball}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/docker-import/},
note = {Permanent ID iil:note:7zw113xn. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- docker-import.schema.json (schema; CC-BY-4.0)
- docker-import.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-import.md.