# docker import: Create an Image from a Tarball

> How docker import works: building a single-layer image from a filesystem tar, setting CMD on import, and the runnable-image pitfall.

Source: https://latchkey.dev/learn/command-reference/docker-import-command  
Updated: 2026-06-25

Turn a filesystem tarball into a single-layer image.

docker import creates an image from a flat filesystem tar (such as one from docker export or a rootfs). This page covers setting metadata on import and how it differs from docker load.

## What it does

docker import reads a tar of a root filesystem and produces a new single-layer image. Because the source has no image config, you typically set CMD/ENTRYPOINT with --change so the image is runnable.

## Common usage

```Terminal
docker import rootfs.tar myrootfs:latest
docker import --change "CMD [\"/app/start\"]" rootfs.tar myapp:latest
cat rootfs.tar.gz | docker import - myrootfs:latest
```

## Common errors in CI

The imported image runs nothing by default - "docker: Error response from daemon: No command specified" - because import does not carry CMD/ENTRYPOINT. Set them with --change. To restore a full image with history and tags, use docker load (with a docker save archive), not import.

## FAQ

### docker import: Create an Image from a Tarball?

docker import creates an image from a flat filesystem tar (such as one from docker export or a rootfs). This page covers setting metadata on import and how it differs from docker load.

### What it does?

docker import reads a tar of a root filesystem and produces a new single-layer image. Because the source has no image config, you typically set CMD/ENTRYPOINT with --change so the image is runnable.

### Common errors in CI?

The imported image runs nothing by default - "docker: Error response from daemon: No command specified" - because import does not carry CMD/ENTRYPOINT. Set them with --change. To restore a full image with history and tags, use docker load (with a docker save archive), not import.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
