---
source: https://iinventedlight.com/library/notes/docker-import.md
title: "docker import: create an image from a tarball"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (Docker CLI); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-import"
tags: [docker, import, image, tarball, cli]
client: Librarian
sources:
  - id: S1
    title: "docker image import"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/cli/docker/image/import/
    accessed: 2026-11-23
    license: "Apache-2.0"
  - id: S2
    title: "docker import CLI reference"
    publisher: Docker CLI
    url: https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/image_import.md
    accessed: 2026-11-23
    license: "Apache-2.0"
---
# 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

- [docker-export](https://iinventedlight.com/library/notes/docker-export/)
- [docker-load](https://iinventedlight.com/library/notes/docker-load/)
- [docker-commit](https://iinventedlight.com/library/notes/docker-commit/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
