gpt4 book ai didi

packer - 对失败的打包程序构建进行故障排除

转载 作者:行者123 更新时间:2023-12-04 22:11:55 24 4
gpt4 key购买 nike

我刚开始使用Packer,并且在某些情况下我的构建失败,因此我希望登录到该机中调查原因。但是,似乎没有packer login或类似命令可以给我一个 shell 。取而代之的是,在我有机会进行调查之前,奔跑只是终止并撕毁了箱子。

我知道我可以在每个阶段使用--debug标志来暂停执行,但是我想知道是否有一种方法可以在失败的运行后(以及清理之前)暂停,然后在调试完成后进行清理。

谢谢。

最佳答案

这是我对packer的最大烦恼。值得庆幸的是,packer build现在具有一个-on-error选项,可以为您提供选项。
packer build -on-error=ask ...进行救援。

packer build文档:

-on-error=cleanup (default), -on-error=abort, -on-error=ask - Selects what to do when the build fails. cleanup cleans up after the previous steps, deleting temporary files and virtual machines. abort exits without any cleanup, which might require the next build to use -force. ask presents a prompt and waits for you to decide to clean up, abort, or retry the failed step.

关于packer - 对失败的打包程序构建进行故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27803494/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com