使用dfimage查看docker镜像的Dockerfile构建过程

816 阅读1分钟

摘要:本文主要介绍使用dfimage工具来查询docker镜像的Dockerfile构建步骤的简单使用。

介绍

dfimage是一个查询已经封装好的docker镜像的构建过程的工具,平常我们使用该工具来做一些基础镜像的转换工作。

使用介绍

定义命令

临时命令

alias dfimage="docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock:ro alpine/dfimage"

永久命令

编辑/etc/profile文件新增如下内容

alias dfimage="docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock:ro alpine/dfimage"

再运行如下命令生效

source /etc/profile

使用

dfimage -sV=1.36 nginx:1.23

image.png