我正在尝试在Openshift 3.x上运行Quarkus本机图像应用程序。
我已经按照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中构建映像,并且在部署容器时它失败并显示:
错误:无法启动容器“ quarkus-native-ms-users”:错误 守护程序的响应:{“ message”:“无效的标题字段值\” oci 运行时错误:container_linux.go:247:启动容器进程 引起\\“ exec:\\\\”。/application \\\\“:权限 拒绝\\“ \ n \”“}
这张图片怎么了?
答案 0 :(得分:0)
问题是我缺少二进制文件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"]