← All notes

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

Sources

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

Permanent ID: iil:note:7zw113xn

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.},
}

Markdown

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.

All artifact files (JSON index)

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.