[英]How to debug Code Engine build errors (Dockerfile strategy)?
I am using IBM Cloud Code Engine.我正在使用 IBM Cloud Code Engine。 Building the container locally, pushing it to the IBM Container Registry and then creating the Code Engine app from it works.
在本地构建容器,将其推送到 IBM Container Registry,然后从中创建 Code Engine 应用程序。 Now, I wanted to build the container image using Code Engine.
现在,我想使用代码引擎构建容器映像。 The code is in a public GitHub repository.
该代码位于公共 GitHub 存储库中。 I am using the build strategy "Dockerfile" based on this Dockerfile .
我正在使用基于此Dockerfile的构建策略“Dockerfile”。
When I submit a build using the console, it fails after a while and I see these lines in the output.当我使用控制台提交构建时,它会在一段时间后失败,并且我在输出中看到这些行。
#13 1.368 Collecting ibm_db>=3.0.2
#13 1.374 Downloading ibm_db-3.1.2.tar.gz (1.1 MB)
#13 1.381 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 234.4 MB/s eta 0:00:00
#13 1.711 Installing build dependencies: started
#13 5.425 Installing build dependencies: finished with status 'done'
#13 5.430 Getting requirements to build wheel: started
#13 6.751 Getting requirements to build wheel: finished with status 'done'
#13 6.752 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpqm5wa7sq/output.json'
How can I investigate this further?我该如何进一步调查? Could the errors be from different tools creating the container image?
错误可能来自创建容器映像的不同工具吗? How would I proceed?
我将如何进行?
There are several options on how to approach the issue:关于如何解决这个问题有几种选择:
First and most important: Obtain and check the logs for anything suspicious .首先也是最重要的: 获取并检查日志是否有任何可疑之处。 The logs are available in the Code Engine browser console for the buildruns, or via command line:
日志可在构建运行的代码引擎浏览器控制台中或通过命令行获得:
ibmcloud ce buildrun logs --name mybuildrun
In addition, there is extra information on the buildrun by using either此外,还有关于 buildrun 的额外信息,使用
ibmcloud ce buildrun get --name mybuildrun
or或者
ibmcloud ce buildrun events --name mybuildrun
On a new GitHub branch or better locally, modify the Dockerfile and add extra steps to access files of interest or print additional debugging output.在新的 GitHub 分支或更好的本地分支上,修改 Dockerfile 并添加额外的步骤来访问感兴趣的文件或打印额外的调试输出。 The latter could be done be adding
|| cat /some/log/file
后者可以添加
|| cat /some/log/file
|| cat /some/log/file
to a failing step. || cat /some/log/file
到失败的步骤。
Make sure that all requirements and packages that are installed are correct and available.确保安装的所有要求和软件包都正确且可用。
Check the dependencies for known issues.检查已知问题的依赖关系。
In the case that lead to my question I needed more debug output to find an issue with a broken software module from my requirements.txt.在导致我的问题的情况下,我需要更多的调试输出来从我的 requirements.txt 中找到与损坏的软件模块有关的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.