Cloud Run 作业中出现随机“在文件 /etc/passwd 中找不到用户”错误

问题描述 投票:0回答:1

我在作业执行的 5% 中遇到以下随机错误,并且使用 相同的容器映像:

Application failed to start: resolveUserIdentity("1001"): User not found in file /etc/passwd

enter image description here

我的dockerfile:

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7

RUN microdnf install freetype fontconfig \
    && microdnf clean all
WORKDIR /work/
RUN chown 1001 /work \
    && chmod "g+rwX" /work \
    && chown 1001:root /work
COPY --chown=1001:root target/*.properties target/*.so /work/
COPY --chown=1001:root target/*-runner /work/application


EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

有什么想法吗?

google-cloud-platform google-cloud-run jobs
1个回答
0
投票

我在 Dockerfile 中的所有引用中解决了将用户 1001 编辑为用户 0 的问题,并在 GCP 故障排除中对错误进行了类似的修复:

https://cloud.google.com/run/docs/troubleshooting?hl=en#error_user_root_is_not_found_in_etcpasswd

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7

RUN microdnf install freetype fontconfig \
    && microdnf clean all
WORKDIR /work/
RUN chown 0 /work \
    && chmod "g+rwX" /work \
    && chown 0:root /work
COPY --chown=0:root target/*.properties target/*.so /work/
COPY --chown=0:root target/*-runner /work/application


EXPOSE 8080
USER 0

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
© www.soinside.com 2019 - 2024. All rights reserved.