How to Inspect a Docker Image’s Content Without Starting a Container

How to Inspect a Docker Image’s Content Without Starting a Container

文章链接: https://www.howtogeek.com/devops/how-to-inspect-a-docker-images-content-without-starting-a-container/

方法一:使用 create 命令创建容器但不运行

docker create --name suspect-container suspect-image:latest
docker export suspect-container > suspect-container.tar

方法二:使用 image save 命令保存镜像每一层的元数据和文件

docker image save suspect-image:latest > suspect-image.tar

修订记录

2022-10-08T16:06:39+08:00