#633  docker持续部署时找不到执行文件
Closed
xs opened 2 years ago

failed.png我可以持续集成,但是部署时 docker no such file or directory: unknown。我用job集成好的image直接run都是ok的。

ok.png 这是我直接用job集成好的image运行的。

Robin Shen commented 2 years ago

这种问题我很难回答,最好提供一个完整的例子。

xs commented 2 years ago

Dockerfile.png 您好,这是我的Dockerfile

image_2.png 这是代码示例

image_3.png image_4.png 我直接在Docker运行image是正常的

Robin Shen commented 2 years ago

建议创建一个OneDev的示例项目来说明你的问题,然后把项目的git仓库附上。

xs commented 2 years ago

https://github.com/justdoit221/onedev-test-ci 这是仓库地址,还请您有空查验下

Robin Shen commented 2 years ago

这是OneDev的问题:在run hello里指定了working dir为/data,为了方便在容器内部访问仓库文件和其他step生成的文件,OneDev会将当前仓库的根目录mount为指定的工作目录,即/data,从而导致容器自己的/data被覆盖,所以导致找不到./bin/hello文件。

我创建了issue #634,请关注。这样在解决该问题的版本发布时会收到通知。

xs commented 2 years ago

😃 感谢解答,已关注 也很感谢OneDev这么棒的开源项目

Robin Shen changed state to 'Closed' 2 years ago
Previous Value Current Value
Open
Closed
Robin Shen commented 2 years ago

Fixed in build #2390

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (4)
Reference
onedev/server#633
Please wait...
Page is in error, reload to recover