命令如下:
docker history --format {{.CreatedBy}} --no-trunc=true tag:version |sed "s?/bin/sh\ -c\ \#(nop)\ ??g"|sed "s?/bin/sh\ -c?RUN?g" | tac
eg:
docker history --format {{.CreatedBy}} --no-trunc=true topsec/shiro-721:latest|sed "s?/bin/sh\ -c\ \#(nop)\ ??g"|sed "s?/bin/sh\ -c?RUN?g" | tac
也可以直接将其导出查看
docker history --format {{.CreatedBy}} --no-trunc=true topsec/shiro-721:latest|sed "s?/bin/sh\ -c\ \#(nop)\ ??g"|sed "s?/bin/sh\ -c?RUN?g" | tac > Dockerfile