container_linux.go:247:无效的 header 字段值 - 权限 > 被拒绝 - OpenShift 上的 Quarkus 本机图像存在问题

container_linux.go:247: invalid header field value - permission > denied - Problem with Quarkus native image on OpenShift

我正在尝试 运行 Openshift 上的 Quarkus 本机图像应用程序 3.x。

我已经按照 Quarkus 的说明在 Fedora 机器上生成了原生镜像:

./mvnw package -Pnative

我已验证生成的二进制文件 运行 在 Fedora 机器中正常:

2019-05-30 08:45:06,957 INFO  [io.quarkus] (main) Quarkus 0.15.0 started in 0.052s. Listening on: http://0.0.0.0:8080
2019-05-30 08:45:06,963 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jsonb]
^C2019-05-30 08:45:12,836 INFO  [io.quarkus] (main) Quarkus stopped in 0.011s

然后我将该图像插入 Docker 容器中:

FROM registry.fedoraproject.org/fedora-minimal
WORKDIR /work/

RUN curl -v -H 'Cache-Control: no-cache' -fSL "http://xxx/quarkus-ms-users-1.0-SNAPSHOT-runner" -o /work/application

RUN ls -la /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

我在 Openshift 中构建镜像,当部署容器时它失败了:

Error: failed to start container "quarkus-native-ms-users": Error response from daemon: {"message":"invalid header field value \"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\"./application\\": permission denied\"\n\""}

这张图片有什么问题?

问题是我缺少二进制文件的执行权限 RUN chmod +x /work/application

完整的 Dockerfile:

FROM registry.fedoraproject.org/fedora-minimal
WORKDIR /work/

RUN curl -v -H 'Cache-Control: no-cache' -fSL "http://xxx/quarkus-ms-users-1.0-SNAPSHOT-runner" -o /work/application
RUN chmod +x /work/application
RUN ls -la /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]