← 返回命令列表

Linux command

podman-import 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Import tarball as image

podman import [file.tar] [image:tag]

Import from URL

podman import [https://example.com/rootfs.tar] [image]

Import with changes

podman import --change "CMD [/bin/bash]" [file.tar] [image]

说明

podman import creates a new container image from a filesystem tarball (or URL). Unlike podman load, which restores a previously saved image with all its layers and metadata, import creates a flat single-layer image from a root filesystem archive. The --change option allows applying Dockerfile instructions (like CMD, ENTRYPOINT, ENV) to the imported image. This is typically used with archives created by podman export or other tools that produce root filesystem tarballs.

参数

--change _INSTRUCTION_
Apply Dockerfile instruction.
-m, --message _MSG_
Commit message.

FAQ

What is the podman-import command used for?

podman import creates a new container image from a filesystem tarball (or URL). Unlike podman load, which restores a previously saved image with all its layers and metadata, import creates a flat single-layer image from a root filesystem archive. The --change option allows applying Dockerfile instructions (like CMD, ENTRYPOINT, ENV) to the imported image. This is typically used with archives created by podman export or other tools that produce root filesystem tarballs.

How do I run a basic podman-import example?

Run `podman import [file.tar] [image:tag]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --change _INSTRUCTION_ do in podman-import?

Apply Dockerfile instruction.