ConsistentInstructionCasing

输出

Command 'EntryPoint' should be consistently cased

描述

指令关键字应使用一致的命名大小写(全部小写或全部大写)。使用混合大小写的命名,例如 PascalCasesnakeCase,会导致可读性差。

示例

❌ 错误:不要混用大小写。

From alpine
Run echo hello > /greeting.txt
EntRYpOiNT ["cat", "/greeting.txt"]

✅ 正确:全部大写。

FROM alpine
RUN echo hello > /greeting.txt
ENTRYPOINT ["cat", "/greeting.txt"]

✅ 正确:全部小写。

from alpine
run echo hello > /greeting.txt
entrypoint ["cat", "/greeting.txt"]
© . This site is unofficial and not affiliated with Kubernetes or Docker Inc.