LinuxCommandLibrary

podman-import

TLDR

Import a tarball from a local file and create an image

$ podman import [path/to/tarball.tar] [image:tag]
copy

Import a tarball from a URL
$ podman import [https://example.com/image.tar] [image:tag]
copy

Import a tarball and add a commit message
$ podman import [[-m|--message]] "[commit_message]" [path/to/tarball.tar] [image:tag]
copy

Import a tarball and set a default command (required for running the container)
$ podman import [[-c|--change]] CMD=[/bin/bash] [path/to/tarball.tar] [image:tag]
copy

SYNOPSIS

podman import [options] file|URL|- [REFERENCE]

PARAMETERS

--change, -c instruction
    Apply Dockerfile-like instructions (e.g., ENV, LABEL, USER) during import

--message, -m string
    Commit message for the imported image

--os string
    Target OS (default: linux)

--architecture, -a string
    Target CPU architecture

--platform string
    OS/ARCH combo (e.g., linux/amd64; overrides --os/-a)

--quiet, -q
    Suppress progress and output

DESCRIPTION

podman import extracts a tarball archive into a new container image, creating a single layer from the filesystem contents. Input sources include local files, HTTP/HTTPS URLs, or stdin ('-'). Specify an optional REFERENCE (e.g., image name:tag) to tag the resulting image; otherwise, only the image ID is output.

This command is ideal for converting root filesystems from VMs, containers (via podman export), or custom dumps into OCI-compatible images. Imported images start with minimal metadata—no CMD, ENTRYPOINT, USER, or history—making --change essential for adding configuration like ENV, LABEL, or EXPOSE via Dockerfile syntax.

Use --os and --architecture (or --platform) to set image manifest details. A commit --message documents changes. --quiet reduces output verbosity.

Unlike podman load (for OCI image tars), import builds images from raw FS archives, mimicking Docker's import for legacy workflows.

CAVEATS

Creates single-layer images with no default config, history, or multi-arch support. Tarball must be untar-able filesystem; use --change for metadata.

EXAMPLE

podman import fs.tar myimage:latest
podman import - myimage --change 'ENV PATH=/usr/bin' --message 'Custom import'

CHANGE INSTRUCTIONS

Supported: ADD, COPY, CMD, ENV, ENTRYPOINT, EXPOSE, LABEL, USER, WORKDIR, VOLUME, STOPSIGNAL, HEALTHCHECK

HISTORY

Available since Podman 1.0 (2018); provides daemonless Docker import compatibility, evolved with OCI spec support in later versions.

SEE ALSO

podman export(1), podman load(1), podman save(1)

Copied to clipboard