【问题标题】:Dockerfile: QIODevice::seek: Cannot call seek on a sequential deviceDockerfile:QIODevice::seek:无法在顺序设备上调用 seek
【发布时间】:2019-11-22 23:57:00
【问题描述】:

我尝试在 docker 容器中构建应用程序。

如果我在主机上构建此映像,一切顺利。如果我将它推送到 git,hub.docker 在构建日志中显示以下错误:

Step 12/22 : RUN qmake /opt/xflr5
---> Running in 026abab3988e
Info: creating stash file /opt/build/.qmake.stash
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
QIODevice::seek: Cannot call seek on a sequential device
Removing intermediate container 026abab3988e
---> e032d94fd731
Step 13/22 : RUN make
---> Running in 69db13aebe2b
g++ -Wl,-O1 -Wl,-rpath,/usr/local/lib -o xflr5 -L/usr/local/lib -lQt5Gui -lQt5Core -lGL -lpthread
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [xflr5] Error 1
Makefile:235: recipe for target 'xflr5' failed

对应的Dockerfile可以找到here

为什么这发生在 hub.docker 而不是我的主机。我该如何解决这个问题?

【问题讨论】:

  • @jww 由于代码不是来自我,这可能需要一个补丁。但是为什么这发生在 docker hub 上而不是我的主机上呢?我什至没有收到关于我的主机的警告。
  • 我应用了一个补丁,将seek 更改为readseek 只出现一次。但是docker hub上仍然存在错误。
  • 由于类似的问题,我偶然发现了这一点。 qmake 和 lrelease 在本地机器上的 fedora 31 docker 镜像上运行良好,但在 travis-ci 上使用相同的 docker 镜像失败。它适用于 ubuntu 仿生图像。 Qt 版本略有不同。 5.12.2 在工作映像上,5.12.4 在失败映像上。链接:travis-ci.org/fritzing/fritzing-app/jobs/568022167

标签: linux docker build dockerfile


【解决方案1】:

https://github.com/docker/for-linux/issues/208

如果你使用 GitLab,你需要编辑文件 /etc/gitlab-runner/config.toml

[[runners]]  
  ...  
  [runners.docker]  
    ...  
    privileged = true  
    ...  
  [runners.cache]  

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-01
    • 2012-04-16
    • 2017-05-15
    • 2014-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多